public static bool useUnitTests = true;
public static void Calculator()
double a = Convert.ToDouble(Console.ReadLine());
double b = Convert.ToDouble(Console.ReadLine());
char c = Console.ReadLine()[0];
Console.WriteLine(a + b);
Console.WriteLine(a - b);
Console.WriteLine(a * b);
Console.WriteLine(a / b);
Console.WriteLine("Division durch 0 ist nicht erlaubt");
Console.WriteLine("Unbekannter Operator");
public static void Main(string[] args)
var x = new NUnitLite.AutoRun().Execute(new string[]{"--test:ProgramTests", "--noc", "--timeout=1000", "--noresult", "--noh"});
Console.WriteLine("----------------------------------------------");
Console.WriteLine(x==0?"All Test Passed... :¬)": string.Format("{0} tests failed... :¬(", x));
Console.WriteLine("----------------------------------------------");
public class ProgramTests
[TestCase(5, 10, '+', 15)]
[TestCase(6, 7, '*', 42)]
[TestCase(99, 9, '-', 90)]
[TestCase(100, 100, '/', 1)]
public void ComputesCorrectly(double a, double b, char c, double expected)
StringWriter testOutput = new StringWriter();
StringReader fakeInput = new StringReader(a.ToString() + "\n" + b.ToString() + "\n" + c.ToString() + "\n");
Console.SetIn(fakeInput);
Console.SetOut(testOutput);
string result = testOutput.ToString().Trim();
Assert.That(result, Does.Match($"{expected}"),
$"\nmindeste erwartete Ausgabe: {expected}\n");