Skip to content

Commit

Permalink
Code coverage for basic test timeout
Browse files Browse the repository at this point in the history
  • Loading branch information
MarkCiliaVincenti committed Dec 29, 2023
1 parent f044a3f commit 896f338
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions AsyncKeyedLock.Tests/StripedAsyncKeyedLocker/OriginalTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,18 @@ public void TestHashHelpersIsPrime2()
HashHelpers.IsPrime(2).Should().Be(true);
}

[Fact]
public async Task TestTimeoutBasic()
{
var asyncKeyedLocker = new StripedAsyncKeyedLocker<string>();
using (var myLock = await asyncKeyedLocker.LockAsync("test", 0))
{
Assert.True(myLock.EnteredSemaphore);
Assert.True(asyncKeyedLocker.IsInUse("test"));
}
Assert.False(asyncKeyedLocker.IsInUse("test"));
}

[Fact]
public async Task TestTimeout()
{
Expand Down

0 comments on commit 896f338

Please sign in to comment.