=== Summary: 675 files | 7 generated | 484 fresh | 4605 untracked | 4268 adopted | 355 marked | 466 validated-ok | 2+0 stale (sig+body) | 0 skipped | 0 failed | elapsed 11:08:11.442 (40091.44s) ===
This commit is contained in:
@@ -18,6 +18,7 @@ public class InMemoryLockProviderTest
|
||||
/// <summary>
|
||||
/// Initializes a fresh <see cref="InMemoryLockProvider"/> instance for the test fixture, ensuring each test starts with a clean, isolated provider state.
|
||||
/// </summary>
|
||||
/// <!-- aidoc:v1 sig=d8eb19f body=68e18d0 -->
|
||||
[SetUp]
|
||||
public void SetUp()
|
||||
{
|
||||
@@ -28,6 +29,7 @@ public class InMemoryLockProviderTest
|
||||
/// Retrieves the private <c>_locks</c> dictionary from the associated <see cref="InMemoryLockProvider"/> instance using reflection, exposing the underlying locks for inspection or manipulation in tests.
|
||||
/// </summary>
|
||||
/// <returns>The <see cref="ConcurrentDictionary{TKey, TValue}"/> mapping lock keys to their <see cref="SemaphoreSlim"/> instances held by the provider.</returns>
|
||||
/// <!-- aidoc:v1 sig=4b79234 body=b646f1a -->
|
||||
private ConcurrentDictionary<string, SemaphoreSlim> GetLocks()
|
||||
{
|
||||
var field = typeof(InMemoryLockProvider)
|
||||
@@ -39,6 +41,7 @@ public class InMemoryLockProviderTest
|
||||
/// <summary>
|
||||
/// Verifies that AcquireAsync returns <c>true</c> and creates a corresponding entry in the locks dictionary when called with a valid key and time span.
|
||||
/// </summary>
|
||||
/// <!-- aidoc:v1 sig=a1004f7 body=bd67473 -->
|
||||
[Test]
|
||||
public async Task AcquireAsync_ReturnsTrue_AndCreatesEntryInLocksDictionary()
|
||||
{
|
||||
@@ -55,6 +58,7 @@ public class InMemoryLockProviderTest
|
||||
/// <summary>
|
||||
/// Verifies that AcquireAsync returns false when the semaphore for the specified key is already occupied and the requested timeout expires before the lock can be acquired, and that the underlying semaphore is restored to a count of 1 after release.
|
||||
/// </summary>
|
||||
/// <!-- aidoc:v1 sig=095560b body=d74126f -->
|
||||
[Test]
|
||||
public async Task AcquireAsync_ReturnsFalse_WhenSemaphoreOccupiedAndTimeoutExpires()
|
||||
{
|
||||
@@ -77,6 +81,7 @@ public class InMemoryLockProviderTest
|
||||
/// allowing a subsequent <c>AcquireAsync</c> for the same key to succeed and the semaphore's
|
||||
/// <c>CurrentCount</c> to transition back to its released value.
|
||||
/// </summary>
|
||||
/// <!-- aidoc:v1 sig=f6c51b5 body=9922475 -->
|
||||
[Test]
|
||||
public async Task ReleaseAsync_MakesSemaphoreAvailableForNextAcquire()
|
||||
{
|
||||
@@ -100,6 +105,7 @@ public class InMemoryLockProviderTest
|
||||
/// <summary>
|
||||
/// Verifies that <c>ReleaseAsync</c> does not throw when invoked without a prior <c>AcquireAsync</c> for the given key, and remains safe to call multiple times after a single successful acquire.
|
||||
/// </summary>
|
||||
/// <!-- aidoc:v1 sig=6c5ff9c body=919f96b -->
|
||||
[Test]
|
||||
public async Task ReleaseAsync_DoesNotThrow_WhenCalledWithoutPriorAcquire()
|
||||
{
|
||||
@@ -115,6 +121,7 @@ public class InMemoryLockProviderTest
|
||||
/// <summary>
|
||||
/// Verifies that <c>AcquireAsync</c> is thread-safe for a given key, ensuring that only one caller can hold the semaphore at a time even when multiple tasks compete concurrently for the same key, and that a single semaphore instance is created and reused per key.
|
||||
/// </summary>
|
||||
/// <!-- aidoc:v1 sig=d53d431 body=e5e915a -->
|
||||
[Test]
|
||||
public async Task AcquireAsync_IsThreadSafe_OnlyOneHolderAtATime_SingleSemaphorePerKey()
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user