Skip to content

Commit

Permalink
Coverage fix
Browse files Browse the repository at this point in the history
  • Loading branch information
MarkCiliaVincenti committed Dec 29, 2023
1 parent efdeced commit c8660d7
Showing 1 changed file with 17 additions and 3 deletions.
20 changes: 17 additions & 3 deletions AsyncKeyedLock.Tests/AsyncKeyedLocker/OriginalTests.cs
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
using AsyncKeyedLock.Tests.Helpers;
using FluentAssertions;
using FluentAssertions.Common;
using ListShuffle;
using System.Collections;
using System.Collections.Concurrent;
using System.Collections.Generic;
using Xunit;

namespace AsyncKeyedLock.Tests.AsyncKeyedLocker
Expand Down Expand Up @@ -139,6 +136,23 @@ public void TestDisposeDoesNotThrow()
action.Should().NotThrow();
}

[Fact]
public void TestDisposeDoesNotThrowDespiteDisposedSemaphoreSlim()
{
Action action = () =>
{
var asyncKeyedLocker = new AsyncKeyedLocker<string>(o =>
{
o.PoolSize = 20;
o.PoolInitialFill = 1;
});
AsyncKeyedLockReleaser<string> releaser = (AsyncKeyedLockReleaser<string>)asyncKeyedLocker.Lock("test");
releaser.SemaphoreSlim.Dispose();
asyncKeyedLocker.Dispose();
};
action.Should().NotThrow();
}

[Fact]
public void TestIndexDoesNotThrow()
{
Expand Down

0 comments on commit c8660d7

Please sign in to comment.