Skip to content

StepError event not raised when a step fails because of a sub-step #66

@D0tNet4Fun

Description

@D0tNet4Fun

Given this test case:

public class TestCase_ExpectedResult_FailedAssertion
{
    [Summary("Expected result with one failed assertion")]
    public void Summary()
    {
        TestCase.Current.Descriptor
            .AddStep(StepType.Input, "Input", Input)
            .AddStep(StepType.ExpectedResult, "Expected result", ExpectedResult);
    }

    private void Input()
    {
    }

    private void ExpectedResult()
    {
        ExpectedResultStep.Current.Descriptor
            .Assert("This should fail", () =>
            {
                Assert.Fail("Failed assertion on purpose");
            });
    }
}

Expected outcome: the expected result step fails with StepFailedException. The StepError event is raised for the same exception.

Actual outcome: the expected result step fails with StepFailedException, but the StepError event is not raised at all.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions