Ejemplo 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);
        }
Ejemplo 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);
        }
Ejemplo 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");
        }
Ejemplo 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);
        }
Ejemplo n.º 5
0
        public void Command_of_T_OnInitialization_Is_Invoked()
        {
            var mock   = new MockCommandOfString();
            var result = mock.Execute();

            mock.OnInitializationWasInvoked.ShouldBe(true);
        }
Ejemplo 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);
        }
Ejemplo 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);
        }
Ejemplo 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);
        }