Пример #1
0
        public void Operate_DoDefaultParameter_ReturnsZero()
        {
            //Arrange
            SimpleOperation sp = new SimpleOperation();
            int             x  = 3;
            int             a  = 5;
            int             b  = 7;
            //Act
            int result = sp.operate(x, a, b);

            //Assert
            Assert.AreEqual(0, result);
        }
Пример #2
0
        public void Operate_DoAdd_ReturnsSum()//naming convention - arrange,act,assert
        {
            //Arrange
            SimpleOperation sp = new SimpleOperation();
            int             x  = 1;
            int             a  = 5;
            int             b  = 7;
            //Act
            int result = sp.operate(x, a, b);

            //Assert
            Assert.AreEqual(12, result);
        }
Пример #3
0
        public void Operate_DoSubtract_ReturnsSubtraction()
        {
            //Arrange
            SimpleOperation sp = new SimpleOperation();
            int             x  = 2;
            int             a  = 5;
            int             b  = 7;
            //Act
            int result = sp.operate(x, a, b);

            //Assert
            Assert.AreEqual(-2, result);
        }