Пример #1
0
        public void CaculatorTotalPoint_WhenInputValidDataAndFailExpectation_ShouldBeFail()
        {
            //Arrage
            ICaculator calulator    = new Caculator();
            var        dataCreation = calulator.Creation();
            var        input        = "ANH";
            var        expected     = 10;

            //Act
            var actutal = calulator.TotalPoints(dataCreation, input);

            //Assert
            Assert.AreNotEqual(expected, actutal);
        }
Пример #2
0
        public void CaculatorTotalPoint_WhenInputValidData_ShouldBeSuccess()
        {
            //Arrage
            ICaculator calulator    = new Caculator();
            var        dataCreation = calulator.Creation();
            var        input        = "ANH";
            var        expected     = 6;

            //Act
            var actutal = calulator.TotalPoints(dataCreation, input);

            //Assert
            Assert.AreEqual(expected, actutal);
        }
Пример #3
0
        public void CaculatorTotalPoint_WhenInputIsNull_ShouldThrowArgumentNullException()
        {
            //Arrage
            ICaculator caculator         = new Caculator();
            var        dataCreation      = caculator.Creation();
            var        expectedParamName = "input";
            string     input             = null;

            //Act
            try
            {
                caculator.TotalPoints(dataCreation, input);
            }
            catch (ArgumentNullException e)
            {
                //Assert
                Assert.AreEqual(expectedParamName, e.ParamName);
            }
        }