namespace Tests { [TestClass] public class UnitTest1 { //Positive [TestMethod] public void Sum21_and51_return72() { int a = 21; int b = 51; int except = 72; var calculator = new Calculator.Calculator(); var actual = calculator.Add(a, b); Assert.AreEqual(actual, except); } [TestMethod] public void Sub2345_from7645_return5300() { int a = 7645; int b = 2345; int except = 5300; var calculator = new Calculator.Calculator(); var actual = calculator.Subtract(a, b); Assert.AreEqual(actual, except); } [TestMethod] public void Mul44_by66_return2904() { int a = 44; int b = 66; int except = 2904; var calculator = new Calculator.Calculator(); var actual = calculator.Multiply(a, b); Assert.AreEqual(actual, except); } [TestMethod] public void Div9_by2_return4_5() { int a = 9; int b = 2; float except = 4.5f; var calculator = new Calculator.Calculator(); var actual = calculator.Divide(a, b); Assert.AreEqual(actual, except); } [TestMethod] public void Pow999_by0_return1() { int a = 999; int b = 0; int except = 1; var calculator = new Calculator.Calculator(); var actual = calculator.Power(a, b); Assert.AreEqual(actual, except); } //Negative [TestMethod] public void Sum3_and4_notreturn8() { int a = 3; int b = 4; int except = 8; var calculator = new Calculator.Calculator(); var actual = calculator.Add(a, b); Assert.AreNotEqual(actual, except); } [TestMethod] public void Sub4_from12_notreturn9() { int a = 12; int b = 4; int except = 9; var calculator = new Calculator.Calculator(); var actual = calculator.Subtract(a, b); Assert.AreNotEqual(actual, except); } [TestMethod] public void Mul5_by66_notreturn331() { int a = 5; int b = 66; int except = 331; var calculator = new Calculator.Calculator(); var actual = calculator.Multiply(a, b); Assert.AreNotEqual(actual, except); } [TestMethod] public void Div9_by3_notreturn4() { int a = 9; int b = 3; float except = 4; var calculator = new Calculator.Calculator(); var actual = calculator.Divide(a, b); Assert.AreNotEqual(actual, except); } [TestMethod] public void Pow5_by5_notreturn625() { int a = 5; int b = 5; int except = 625; var calculator = new Calculator.Calculator(); var actual = calculator.Power(a, b); Assert.AreNotEqual(actual, except); } } }