Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Possible bug in ElseIf when Predicate.RequiresDocument is false #255

Closed
nils-a opened this issue Dec 19, 2022 · 0 comments · Fixed by #256
Closed

Possible bug in ElseIf when Predicate.RequiresDocument is false #255

nils-a opened this issue Dec 19, 2022 · 0 comments · Fixed by #256
Labels
⚠️ Bug Something isn't working as expected

Comments

@nils-a
Copy link
Contributor

nils-a commented Dec 19, 2022

Maybe I'm holding it wrong, but I feel I've found a bug.

I've added a failing unit test like this:

[Test]
public async Task TrueIfWithFollowingElseIfWithContextResultsInCorrectCounts()
{
    // Given
    CountModule a = new CountModule("A")
    {
        AdditionalOutputs = 2,
        EnsureInputDocument = true
    };
    CountModule b = new CountModule("B")
    {
        AdditionalOutputs = 2
    };
    CountModule c = new CountModule("C")
    {
        AdditionalOutputs = 3
    };

    // When
    await ExecuteAsync(
        a,
        new ExecuteIf(Config.FromContext(_ => true), b)
            .ElseIf(Config.FromContext(_ => true), c));

    // Then
    a.ExecuteCount.ShouldBe(1);
    b.ExecuteCount.ShouldBe(1);
    c.ExecuteCount.ShouldBe(0);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
⚠️ Bug Something isn't working as expected
Development

Successfully merging a pull request may close this issue.

2 participants