forked from shouldly/shouldly
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Assortment of Minor Improvements (shouldly#962)
* An assortment of minor improvements * Set SuppressTfmSupportBuildWarnings * Make TimeProvider TFM conditional * Update documentation snippets * Use common wait times everywhere * Fix CI * Add Polyfill * Update LangVersion * Fix CI detection * Fix CI detection * Add debugging code * Add more fixes * Collection expressions everywhere * Revert unintentional change
- Loading branch information
Showing
60 changed files
with
294 additions
and
220 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
...ionExamples/CodeExamples/ShouldCompleteInExamples.ShouldCompleteIn.codeSample.approved.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
Should.CompleteIn( | ||
action: () => { Thread.Sleep(TimeSpan.FromSeconds(2)); }, | ||
timeout: TimeSpan.FromSeconds(1), | ||
action: () => { Thread.Sleep(TimeSpan.FromSeconds(15)); }, | ||
timeout: TimeSpan.FromSeconds(0.5), | ||
customMessage: "Some additional context"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,7 +2,7 @@ | |
|
||
Delegate | ||
should complete in | ||
00:00:01 | ||
00:00:00.5000000 | ||
but did not | ||
|
||
Additional Info: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
namespace Shouldly.Tests; | ||
|
||
internal static class CommonWaitDurations | ||
{ | ||
private static readonly bool IsRunningOnContinuousIntegration = | ||
Environment.GetEnvironmentVariable("CI") | ||
?.Equals("true", StringComparison.OrdinalIgnoreCase) | ||
?? false; | ||
|
||
public static TimeSpan ShortWait => | ||
TimeSpan.FromSeconds(IsRunningOnContinuousIntegration ? 0.5 : 0.2); | ||
|
||
public static TimeSpan LongWait => | ||
TimeSpan.FromSeconds(IsRunningOnContinuousIntegration ? 15 : 5); | ||
|
||
public static TimeSpan ImmediateTaskTimeout => | ||
TimeSpan.FromSeconds(IsRunningOnContinuousIntegration ? 2 : 0.5); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
using System.Runtime.CompilerServices; | ||
using static Shouldly.Tests.CommonWaitDurations; | ||
|
||
namespace Shouldly.Tests; | ||
|
||
internal static class ModuleInitializer | ||
{ | ||
[ModuleInitializer] | ||
internal static void Initialize() | ||
{ | ||
ShouldlyConfiguration.DefaultTaskTimeout = LongWait; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.