Skip to content

Conversation

@vbreuss
Copy link
Member

@vbreuss vbreuss commented Oct 22, 2024

Building on top of #35 fixes #34 also for typed exceptions:

  [Fact]
  public async Task ShouldSupportChainedConstraints()
  {
    Action action = () => { };
  
    await Expect.That(action).Throws<MyCustomException>()
      .OnlyIf(false)
      .Which.HasMessage("foo");
  }

@vbreuss vbreuss added the bug Something isn't working label Oct 22, 2024
@vbreuss vbreuss self-assigned this Oct 22, 2024
@vbreuss vbreuss enabled auto-merge (squash) October 22, 2024 06:52
@vbreuss vbreuss merged commit 7f3e92f into main Oct 22, 2024
6 checks passed
@vbreuss vbreuss deleted the topic/fix-only-if-also-for-typed-exceptions branch October 22, 2024 06:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

OnlyIf does not work for chained expectations

2 participants