Esempio n. 1
0
        public void AdderMustAdd()
        {
            Adder theAdder = new Adder(1, 2);

            theAdder.Calculate();
            Assert.Equal(3, theAdder.Result);
        }
Esempio n. 2
0
        public void Calculate()
        {
            Adder  calculator = new Adder();
            double result     = calculator.Calculate(10, 5);

            Assert.AreEqual(15, result);
        }
Esempio n. 3
0
        public void CalculateTest()
        {
            ITwoArgumentsCalculator calculator = new Adder();
            double result = calculator.Calculate(4, 2);

            Assert.AreEqual(6, result);
        }
Esempio n. 4
0
        public void AdderTest()
        {
            Adder  calculator = new Adder();
            double result     = calculator.Calculate(2, 5);

            Assert.AreEqual(7, result);
        }
Esempio n. 5
0
        public void CalculatorTests()
        {
            var    calculator = new Adder();
            double actual     = calculator.Calculate(1, 2);

            Assert.AreEqual(3, actual: actual);
        }
Esempio n. 6
0
        public void CalculatesCorrectly()
        {
			var adder = new Adder();
			adder.Add(1);
			adder.Add(2);
			var result = adder.Calculate();
			Assert.Equal(3, result);
		}
Esempio n. 7
0
        public void CalculateTest(
            double firstValue,
            double secondValue,
            double expected)
        {
            var calculator   = new Adder();
            var actualResult = calculator.Calculate(firstValue, secondValue);

            Assert.AreEqual(expected, actualResult);
        }
Esempio n. 8
0
 public void WhenIPressAdd()
 {
     _adder.Calculate();
 }
Esempio n. 9
0
        public void TestAdder()
        {
            IExpression e = new Adder(new Constant(1.0), new Constant(2.0));

            Assert.AreEqual(3, e.Calculate());
        }
Esempio n. 10
0
 public int Add(int a, int b) => _adder.Calculate(a, b);