Exemple #1
0
        public void ExecutionExtension_ValidationSummary()
        {
            string msg1 = "message1",
                   msg2 = "message2",
                   msg3 = "message3";

            var er = new ExecutionResult("ss", null);

            er.Add(new[]
            {
                ValidationStep.BuildValidationResponseStep(true, msg1),
                ValidationStep.BuildValidationResponseStep(false, msg2),
                ValidationStep.BuildValidationResponseStep(false, msg3)
            });
            var vs1 = er.ValidationSummary();

            vs1.Count().ShouldBe(3);
            vs1.Contains(msg1).ShouldBeTrue();
            vs1.Contains(msg2).ShouldBeTrue();
            vs1.Contains(msg3).ShouldBeTrue();

            var vs2 = er.ValidationSummary(true);

            vs2.Count().ShouldBe(1);
            vs2.Contains(msg1).ShouldBeTrue();

            var vs3 = er.ValidationSummary(false);

            vs3.Count().ShouldBe(2);
            vs3.Contains(msg2).ShouldBeTrue();
            vs3.Contains(msg3).ShouldBeTrue();
        }
Exemple #2
0
        public void ExecutionExtension_AddValidationStep()
        {
            var er1 = new ExecutionResult("ss", null);

            er1.Add(ValidationStep.BuildValidationResponseStep(false, "message"));
            er1.ValidationSteps.Any().ShouldBeTrue();
        }
Exemple #3
0
        public void ExecutionExtension_AddValidationStepCollection()
        {
            var er1 = new ExecutionResult("ss", null);

            er1.Add(new[]
            {
                ValidationStep.BuildValidationResponseStep(false, "message"),
                ValidationStep.BuildValidationResponseStep(false, "message"),
                ValidationStep.BuildValidationResponseStep(false, "message")
            });
            er1.ValidationSteps.Count.ShouldBe(3);
        }
Exemple #4
0
        public void ExecutionResult_Errors()
        {
            var er1 = new ExecutionResult("ss", null);

            er1.ExecutionResultSteps.Add(ExecutionResultStep.Build(ExecutionStatus.Passed, "message"));
            er1.HasErrors.ShouldBeFalse();
            er1.HasExecutionErrors.ShouldBeFalse();
            er1.HasValidationErrors.ShouldBeFalse();

            er1.ExecutionResultSteps.Add(ExecutionResultStep.Build(ExecutionStatus.Failed, "message"));
            er1.HasErrors.ShouldBeTrue();
            er1.HasExecutionErrors.ShouldBeTrue();
            er1.HasValidationErrors.ShouldBeFalse();

            var er2 = new ExecutionResult("ss", null);

            er2.ValidationSteps.Add(ValidationStep.BuildValidationResponseStep(false, "message"));
            er2.HasErrors.ShouldBeTrue();
            er2.HasExecutionErrors.ShouldBeFalse();
            er2.HasValidationErrors.ShouldBeTrue();
        }