Exemple #1
0
            public void Does_not_return_success_result_if_parsing_is_not_sucessful()
            {
                //Arrange
                MoqParser.Setup(m => m.Parse(It.IsAny <object>())).Returns(new FailureResult <object>());

                //Act
                var result = CommandWithParsing.Execute(null);

                //Assert
                Assert.AreNotEqual(ResultState.Success, result.State);
            }
Exemple #2
0
            public void Returns_result_of_ExecuteImplementation()
            {
                //Arrange
                var expectedResult = new SuccessResult <object>(new object());

                MoqCommand.Setup(m => m.ExecuteImplementation(It.IsAny <object>())).Returns(expectedResult);

                //Act
                var result = CommandWithParsing.Execute(null);

                //Assert
                Assert.AreSame(expectedResult, result);
            }