Пример #1
0
        public void ShouldExecuteConfusingAPICalls()
        {
            IBetterAPI betterAPI = new BetterAPI();

            //IBetterAPI betterAPIOldStyle = new BetterAPI(new Confusing(), new Overdone("foo"));
            Assert.Equal(6, betterAPI.AddThreeNumbers(1, 2, 3));
            Assert.Equal(20, betterAPI.AddThenMultiply(4, 5));
            Assert.Equal(35, betterAPI.AddThenMultiply(4, 3, 5));
            Assert.Equal(45, betterAPI.AddThenMultiply(4, 3, 2, 5));
        }
        public void AddThreeNumbersTest()
        {
            // Arrange
            IBetterAPI betterAPI = new BetterAPI();
            var        value1    = 4;
            var        value2    = 5;
            var        value3    = 9;
            var        expected  = value1 + value2 + value3;

            // Action
            var actual = betterAPI.AddThreeNumbers(value1, value2, value3);

            // Assert
            Assert.AreEqual(expected, actual);
        }