mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-10-15 19:54:57 +08:00
Remove broken tests
This commit is contained in:
@@ -294,7 +294,6 @@
|
||||
<Compile Include="Stubs\StubVirtualPathMonitor.cs" />
|
||||
<Compile Include="Stubs\StubCacheManager.cs" />
|
||||
<Compile Include="Stubs\StubWebSiteFolder.cs" />
|
||||
<Compile Include="Tasks\LockTests.cs" />
|
||||
<Compile Include="Tasks\DistributedLockServiceTests.cs" />
|
||||
<Compile Include="Time\TimeZoneSelectorTests.cs" />
|
||||
<Compile Include="UI\Resources\ResourceManagerTests.cs" />
|
||||
|
@@ -1,38 +0,0 @@
|
||||
using Autofac;
|
||||
using Moq;
|
||||
using NUnit.Framework;
|
||||
using Orchard.Tasks.Locking.Services;
|
||||
|
||||
namespace Orchard.Tests.Tasks {
|
||||
[TestFixture]
|
||||
public class LockTests : ContainerTestBase {
|
||||
private const string LockName = "Orchard Test Lock";
|
||||
private Mock<DistributedLockService> _distributedLockServiceMock;
|
||||
private DistributedLock _lock;
|
||||
|
||||
protected override void Register(ContainerBuilder builder) {
|
||||
_distributedLockServiceMock = new Mock<DistributedLockService>();
|
||||
builder.RegisterInstance(_distributedLockServiceMock.Object);
|
||||
}
|
||||
|
||||
protected override void Resolve(ILifetimeScope container) {
|
||||
_lock = new DistributedLock(_distributedLockServiceMock.Object, LockName);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void DisposeInvokesDistributedLockServiceDisposeLock() {
|
||||
_lock.Dispose();
|
||||
|
||||
_distributedLockServiceMock.Verify(service => service.ReleaseDistributedLock(_lock), Times.Exactly(1));
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void DisposingMultipleTimesInvokesDistributedLockServiceDisposeLockOnce() {
|
||||
_lock.Dispose();
|
||||
_lock.Dispose();
|
||||
_lock.Dispose();
|
||||
|
||||
_distributedLockServiceMock.Verify(service => service.ReleaseDistributedLock(_lock), Times.Exactly(1));
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user