Skip to content

Commit

Permalink
Fix exception message in NotThrowAfter
Browse files Browse the repository at this point in the history
The messages of the exceptions that are raised
if the TimeSpan parameters of NotThrowAfter are
negative claim that the parameters should be
"positive". Changed to "non-negative".

Further change:
* Minor formatting change
  • Loading branch information
frederik-h committed Nov 9, 2018
1 parent b6a22e1 commit 6bafda9
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions Src/FluentAssertions/Specialized/ActionAssertions.cs
Expand Up @@ -142,17 +142,18 @@ public void NotThrowAfter(TimeSpan waitTime, TimeSpan pollInterval, string becau
FailIfSubjectIsAsyncVoid();

if(waitTime < TimeSpan.Zero)
throw new ArgumentOutOfRangeException(nameof(waitTime), $"The value of {nameof(waitTime)} must be positive.");
throw new ArgumentOutOfRangeException(nameof(waitTime), $"The value of {nameof(waitTime)} must be non-negative.");

if(pollInterval < TimeSpan.Zero)
throw new ArgumentOutOfRangeException(nameof(pollInterval), $"The value of {nameof(pollInterval)} must be positive.");
throw new ArgumentOutOfRangeException(nameof(pollInterval), $"The value of {nameof(pollInterval)} must be non-negative.");

TimeSpan? invocationEndTime = null;
Exception exception = null;

var watch = Stopwatch.StartNew();

using(var waiter = new ManualResetEvent(false)) {
using(var waiter = new ManualResetEvent(false))
{
while (invocationEndTime is null || invocationEndTime < waitTime)
{
exception = InvokeSubjectWithInterception();
Expand Down

0 comments on commit 6bafda9

Please sign in to comment.