Skip to content

Commit

Permalink
Added missing lock tests from test base.
Browse files Browse the repository at this point in the history
  • Loading branch information
niemyjski committed Mar 21, 2024
1 parent a4f6847 commit c032deb
Show file tree
Hide file tree
Showing 4 changed files with 47 additions and 34 deletions.
10 changes: 0 additions & 10 deletions .idea/.idea.Foundatio.Redis/.idea/.gitignore

This file was deleted.

6 changes: 0 additions & 6 deletions .idea/.idea.Foundatio.Redis/.idea/misc.xml

This file was deleted.

2 changes: 1 addition & 1 deletion .idea/.idea.Foundatio.Redis/.idea/vcs.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

63 changes: 46 additions & 17 deletions tests/Foundatio.Redis.Tests/Locks/RedisLockTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
using Foundatio.Redis.Tests.Extensions;
using Foundatio.Tests.Locks;
using Foundatio.Utility;
using Foundatio.Xunit;
using Microsoft.Extensions.Logging;
using Xunit;
using Xunit.Abstractions;
Expand Down Expand Up @@ -37,22 +36,64 @@ protected override ILockProvider GetLockProvider()
return new CacheLockProvider(_cache, _messageBus, Log);
}

[Fact]
public override Task CanAcquireAndReleaseLockAsync()
{
return base.CanAcquireAndReleaseLockAsync();
}

[Fact]
public override Task LockWillTimeoutAsync()
{
return base.LockWillTimeoutAsync();
}

[Fact]
public override Task LockOneAtATimeAsync()
{
return base.LockOneAtATimeAsync();
}

[Fact]
public override Task CanAcquireMultipleResources()
{
return base.CanAcquireMultipleResources();
}

[Fact]
public override Task CanAcquireLocksInParallel()
{
return base.CanAcquireLocksInParallel();
}

// [Fact]
// public override Task CanAcquireScopedLocksInParallel()
// {
// return base.CanAcquireScopedLocksInParallel();
// }
//
// [Fact]
// public override Task CanAcquireMultipleLocksInParallel()
// {
// return base.CanAcquireMultipleLocksInParallel();
// }

[Fact]
public override Task CanAcquireAndReleaseLockAsync()
public override Task CanAcquireMultipleScopedResources()
{
return base.CanAcquireAndReleaseLockAsync();
return base.CanAcquireMultipleScopedResources();
}

[Fact]
public override Task LockWillTimeoutAsync()
public override Task WillThrottleCallsAsync()
{
return base.LockWillTimeoutAsync();
return base.WillThrottleCallsAsync();
}

[Fact]
public override Task CanReleaseLockMultipleTimes()
{
return base.CanReleaseLockMultipleTimes();
}

[Fact]
Expand Down Expand Up @@ -91,18 +132,6 @@ public async Task LockWontTimeoutEarly()
Assert.True(sw.ElapsedMilliseconds > 400);
}

[RetryFact]
public override Task WillThrottleCallsAsync()
{
return base.WillThrottleCallsAsync();
}

[Fact]
public override Task LockOneAtATimeAsync()
{
return base.LockOneAtATimeAsync();
}

public void Dispose()
{
_cache.Dispose();
Expand Down

0 comments on commit c032deb

Please sign in to comment.