Skip to content

Commit

Permalink
Fix ShouldThrow syntax errors in specs
Browse files Browse the repository at this point in the history
  • Loading branch information
YarekTyshchenko committed Oct 15, 2021
1 parent f232595 commit e566ea9
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/Polly.Specs/RateLimit/RateLimitPolicySpecsBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -57,47 +57,47 @@ public void Syntax_should_throw_for_perTimeSpan_zero()
{
Action invalidSyntax = () => GetPolicyViaSyntax(1, TimeSpan.Zero);

invalidSyntax.ShouldThrow<ArgumentOutOfRangeException>().And.ParamName.Should().Be("perTimeSpan");
invalidSyntax.Should().Throw<ArgumentOutOfRangeException>().And.ParamName.Should().Be("perTimeSpan");
}

[Fact]
public void Syntax_should_throw_for_numberOfExecutions_negative()
{
Action invalidSyntax = () => GetPolicyViaSyntax(-1, TimeSpan.FromSeconds(1));

invalidSyntax.ShouldThrow<ArgumentOutOfRangeException>().And.ParamName.Should().Be("numberOfExecutions");
invalidSyntax.Should().Throw<ArgumentOutOfRangeException>().And.ParamName.Should().Be("numberOfExecutions");
}

[Fact]
public void Syntax_should_throw_for_numberOfExecutions_zero()
{
Action invalidSyntax = () => GetPolicyViaSyntax(0, TimeSpan.FromSeconds(1));

invalidSyntax.ShouldThrow<ArgumentOutOfRangeException>().And.ParamName.Should().Be("numberOfExecutions");
invalidSyntax.Should().Throw<ArgumentOutOfRangeException>().And.ParamName.Should().Be("numberOfExecutions");
}

[Fact]
public void Syntax_should_throw_for_perTimeSpan_negative()
{
Action invalidSyntax = () => GetPolicyViaSyntax(1, TimeSpan.FromTicks(-1));

invalidSyntax.ShouldThrow<ArgumentOutOfRangeException>().And.ParamName.Should().Be("perTimeSpan");
invalidSyntax.Should().Throw<ArgumentOutOfRangeException>().And.ParamName.Should().Be("perTimeSpan");
}

[Fact]
public void Syntax_should_throw_for_maxBurst_negative()
{
Action invalidSyntax = () => GetPolicyViaSyntax(1, TimeSpan.FromSeconds(1), -1);

invalidSyntax.ShouldThrow<ArgumentOutOfRangeException>().And.ParamName.Should().Be("maxBurst");
invalidSyntax.Should().Throw<ArgumentOutOfRangeException>().And.ParamName.Should().Be("maxBurst");
}

[Fact]
public void Syntax_should_throw_for_maxBurst_zero()
{
Action invalidSyntax = () => GetPolicyViaSyntax(1, TimeSpan.FromSeconds(1), 0);

invalidSyntax.ShouldThrow<ArgumentOutOfRangeException>().And.ParamName.Should().Be("maxBurst");
invalidSyntax.Should().Throw<ArgumentOutOfRangeException>().And.ParamName.Should().Be("maxBurst");
}

[Theory]
Expand Down

0 comments on commit e566ea9

Please sign in to comment.