Exemple #1
0
 public void Test_Square_Root_Calc()
 {
     Logic.Calculator calculator = new Logic.Calculator();
     calculator.Number_entered(9.0);
     calculator.Square_root_entered();
     calculator.Number_entered(2.0);
     Assert.AreEqual("3", calculator.Equals());
 }
Exemple #2
0
        public void Test_SquareRoot_Negative()
        {
            double lhs = -4;

            Logic.Calculator Calc = new Logic.Calculator();
            Calc.Number_entered(lhs);
            string result = Calc.Square_root_entered();

            Assert.AreEqual("Invalid Input", result);
        }
Exemple #3
0
        public void Test_Reciprocal_Zero()
        {
            double lhs = 0;

            Logic.Calculator Calc = new Logic.Calculator();
            Calc.Number_entered(lhs);
            string result = Calc.Square_root_entered();

            Assert.AreEqual("Divide by Zero Error", result.ToString());
        }