Пример #1
0
        public void ToResult_StepOutcomesEmpty_StepResultsEmpty()
        {
            var ctn            = new Ctn <int>(DefaultValue, None);
            var scenarioResult = ctn.ToResult();

            scenarioResult.Should().NotBeNull();
            scenarioResult.StepResults.Should().NotBeNull();
            scenarioResult.StepResults.Should().BeEmpty();
        }
Пример #2
0
        public void ToResult_ScenarioTitleSet_TitleIsSetDescriptionIsSet()
        {
            var ctn            = new Ctn <int>(DefaultValue, ScenarioTitle);
            var scenarioResult = ctn.ToResult();

            scenarioResult.Should().NotBeNull();
            scenarioResult.StepResults.Should().NotBeNull();
            scenarioResult.Title.Should().Be(ScenarioTitle);
            scenarioResult.Description.Should().Be($"Scenario: {ScenarioTitle}");
        }
Пример #3
0
        public void ToResult_ScenarioTitleNone_TitleIsNullDescriptionIsPrefix()
        {
            var ctn            = new Ctn <int>(DefaultValue, None);
            var scenarioResult = ctn.ToResult();

            scenarioResult.Should().NotBeNull();
            scenarioResult.StepResults.Should().NotBeNull();
            scenarioResult.Title.Should().BeNull();
            scenarioResult.Description.Should().Be("Scenario:");
        }
Пример #4
0
        public void ToResult_MultipleStepOutcomes_StepResultsMapped()
        {
            var stepOutcomes = new List <StepOutcome>
            {
                new StepOutcome(Step.Given, Outcome.Pass, GivenStepTitle),
                new StepOutcome(Step.When, Outcome.Inconclusive, None),
                new StepOutcome(Step.Then, Outcome.NotRun, ThenStepTitle)
            };

            var ctn            = new Ctn <int>(DefaultValue, stepOutcomes, None);
            var scenarioResult = ctn.ToResult();

            scenarioResult.Should().NotBeNull();
            scenarioResult.StepResults.Should().NotBeNull();
            scenarioResult.StepResults.Count.Should().Be(3);

            scenarioResult.StepResults.ShouldHaveOutcomeAtIndex(Outcome.Pass, GivenStepTitle, $"{GivenStepTitle} [Passed]", Step.Given, 0);
            scenarioResult.StepResults.ShouldHaveOutcomeAtIndex(Outcome.Inconclusive, null, "When [Inconclusive]", Step.When, 1);
            scenarioResult.StepResults.ShouldHaveOutcomeAtIndex(Outcome.NotRun, ThenStepTitle, $"{ThenStepTitle} [not run]", Step.Then, 2);
        }