-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Amend exception message on incorrect expiration, throw on double.Nan …
…passed to Trim() and test for that case
- Loading branch information
1 parent
8e6911b
commit cfd1d47
Showing
3 changed files
with
24 additions
and
2 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
using FastCache.Services; | ||
|
||
namespace FastCache.CachedTests.Internals; | ||
|
||
public sealed class CacheManagerTests | ||
{ | ||
[Theory] | ||
[InlineData(double.NaN)] | ||
[InlineData(double.MinValue)] | ||
[InlineData(double.NegativeInfinity)] | ||
[InlineData(-double.Epsilon)] | ||
[InlineData(100.00001)] | ||
[InlineData(100.1D)] | ||
[InlineData(double.MaxValue)] | ||
[InlineData(double.PositiveInfinity)] | ||
public void Trim_Throws_OnInvalidPercentage(double percentage) | ||
{ | ||
void Trim() => CacheManager.Trim<int, object>(percentage); | ||
|
||
Assert.Throws<ArgumentOutOfRangeException>(Trim); | ||
} | ||
} |