Skip to content

Commit

Permalink
Reorder methods logically
Browse files Browse the repository at this point in the history
  • Loading branch information
lg2de committed Aug 14, 2022
1 parent 6441458 commit 78f5d0d
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions Src/FluentAssertions/Specialized/AsyncFunctionAssertions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -293,6 +293,18 @@ async Task<AndConstraint<TAssertions>> AssertionTaskAsync()
}
}

/// <summary>
/// Invokes the subject and measures the sync execution time.
/// </summary>
private protected (TTask result, TimeSpan remainingTime) InvokeWithTimer(TimeSpan timeSpan)
{
ITimer timer = Clock.StartTimer();
TTask result = Subject.Invoke();
TimeSpan remainingTime = timeSpan - timer.Elapsed;

return (result, remainingTime);
}

/// <summary>
/// Monitors the specified task whether it completes withing the remaining time span.
/// </summary>
Expand All @@ -313,18 +325,6 @@ private protected async Task<bool> CompletesWithinTimeoutAsync(Task target, Time
return true;
}

/// <summary>
/// Invokes the subject and measures the sync execution time.
/// </summary>
private protected (TTask result, TimeSpan remainingTime) InvokeWithTimer(TimeSpan timeSpan)
{
ITimer timer = Clock.StartTimer();
TTask result = Subject.Invoke();
TimeSpan remainingTime = timeSpan - timer.Elapsed;

return (result, remainingTime);
}

private static async Task<Exception> InvokeWithInterceptionAsync(Func<Task> action)
{
try
Expand Down

0 comments on commit 78f5d0d

Please sign in to comment.