Skip to content

Commit

Permalink
More dogfooding
Browse files Browse the repository at this point in the history
  • Loading branch information
jnyrup committed Apr 3, 2022
1 parent f7b6174 commit 063fc89
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 16 deletions.
Expand Up @@ -31,16 +31,8 @@ public void When_the_same_failure_is_handled_twice_or_more_it_should_still_repor
Action act = scope.Dispose;

// Assert
try
{
act();
}
catch (Exception exception)
{
int matches = new Regex(".*Failure.*").Matches(exception.Message).Count;

matches.Should().Be(4);
}
act.Should().Throw<XunitException>()
.Which.Message.Should().Contain("Failure", Exactly.Times(4));
}

[InlineData("foo")]
Expand Down
9 changes: 3 additions & 6 deletions Tests/FluentAssertions.Specs/Execution/AssertionScopeSpecs.cs
Expand Up @@ -132,9 +132,7 @@ public void When_multiple_scopes_are_nested_it_should_throw_all_failures_from_th
}
catch (Exception exception)
{
exception.Message.Should().Contain("Failure1");
exception.Message.Should().Contain("Failure2");
exception.Message.Should().Contain("Failure3");
exception.Message.Should().ContainAll("Failure1", "Failure2", "Failure3");
}
}

Expand Down Expand Up @@ -165,9 +163,8 @@ public void When_a_nested_scope_is_discarded_its_failures_should_also_be_discard
}
catch (Exception exception)
{
exception.Message.Should().Contain("Failure1");
exception.Message.Should().Contain("Failure2");
exception.Message.Should().NotContain("Failure3");
exception.Message.Should().ContainAll("Failure1", "Failure2")
.And.NotContain("Failure3");
}
}

Expand Down

0 comments on commit 063fc89

Please sign in to comment.