From 6bafda9b3975b21f3971a1d0c3e939514c48bb1c Mon Sep 17 00:00:00 2001 From: frederik-h Date: Fri, 9 Nov 2018 20:10:30 +0100 Subject: [PATCH] Fix exception message in NotThrowAfter 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 --- Src/FluentAssertions/Specialized/ActionAssertions.cs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/Src/FluentAssertions/Specialized/ActionAssertions.cs b/Src/FluentAssertions/Specialized/ActionAssertions.cs index fec6a8b13f..12f57f4aff 100644 --- a/Src/FluentAssertions/Specialized/ActionAssertions.cs +++ b/Src/FluentAssertions/Specialized/ActionAssertions.cs @@ -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();