public void ShouldSumThreeNumbers() { var calculator = new BetterCalculator(); var sum = calculator.Add(4) .Add(5) .Add(6) .Total(); Assert.That(sum, Is.EqualTo(15)); }
public void ShouldPerformMultipleOperation() { var calculator = new BetterCalculator(); var result = calculator.Add(4) .Multiply(5) .Divide(2) .Total(); Assert.That(result, Is.EqualTo(10)); }
static void Main(string[] args) { BetterCalculator cal = new BetterCalculator(); int res = cal.Add(221, 42343); res = cal.Mul(221, 42343); var res3 = cal.Div(221, 42343); Console.WriteLine(res); Console.WriteLine("Press any key to exit."); Console.ReadLine(); }
static void Main(string[] args) { Console.WriteLine("Hello World!!"); BetterCalculator cal = new BetterCalculator(); var add = cal.Add(10, 20); Console.WriteLine(add); var sub = cal.sub(10, 20); Console.WriteLine(sub); var mul = cal.Add(10, 20); Console.WriteLine(mul); var div = cal.sub(10, 20); Console.WriteLine(div); BestStudent bcal = new BestStudent(); int localSum = bcal.LocalSum(); bcal.BlaBla(); Console.ReadKey(); }