Esempio n. 1
0
        public void Command_of_T_ExecutionResult_Should_Contain_No_Errors_When_Validation_Is_Successful()
        {
            var mock   = new MockCommandOfString();
            var result = mock.Execute();

            result.Errors.ShouldBe(null);
        }
Esempio n. 2
0
        public void Command_of_T_ExecutionResult_Is_Successful_When_Validation_Is_Successful()
        {
            var mock   = new MockCommandOfString();
            var result = mock.Execute();

            result.Success.ShouldBe(true);
        }
Esempio n. 3
0
        public void Command_of_T_Execute_Returns_Value_When_No_Errors_Exist()
        {
            var mock   = new MockCommandOfString();
            var result = mock.Execute();

            result.Value.ShouldBe("some value");
        }
Esempio n. 4
0
        public void Command_of_T_OnExecute_Is_Invoked_When_No_Errors_Exist()
        {
            var mock   = new MockCommandOfString();
            var result = mock.Execute();

            mock.OnExecuteWasInvoked.ShouldBe(true);
        }
Esempio n. 5
0
        public void Command_of_T_OnInitialization_Is_Invoked()
        {
            var mock   = new MockCommandOfString();
            var result = mock.Execute();

            mock.OnInitializationWasInvoked.ShouldBe(true);
        }
Esempio n. 6
0
        public void Command_of_T_OnExecute_Is_Not_Invoked_When_Errors_Exist()
        {
            var mock = new MockCommandOfString();

            mock.Errors = new[] { new ValidationResult("Object doesn't exist") };
            mock.Execute();
            mock.OnExecuteWasInvoked.ShouldBe(false);
        }
Esempio n. 7
0
        public void Command_of_T_ExecutionResult_Should_Contain_Errors_When_Validation_Is_Not_Successful()
        {
            var mock = new MockCommandOfString {
                Errors = new[] { new ValidationResult("Object doesn't exist") }
            };
            var result = mock.Execute();

            result.Errors.Count().ShouldBe(1);
        }
Esempio n. 8
0
        public void Command_of_T_ExecutionResult_Is_Not_Successful_When_Validation_Is_Not_Successful()
        {
            var mock = new MockCommandOfString {
                Errors = new[] { new ValidationResult("Object doesn't exist") }
            };
            var result = mock.Execute();

            result.Success.ShouldBe(false);
        }