Beispiel #1
0
        public void LockShouldBeGrantedWhenDoesNotExist()
        {
            ILockFile lockFile = null;
            var       granted  = _lockFileManager.TryAcquireLock("foo.txt.lock", ref lockFile);

            Assert.True(granted);
            Assert.NotNull(lockFile);
            Assert.True(_lockFileManager.IsLocked("foo.txt.lock"));
            Assert.Equal(_appDataFolder.ListFiles("").Count(), 1);
        }
        public void LockShouldBeGrantedWhenDoesNotExist()
        {
            ILockFile lockFile = null;
            var       granted  = _lockFileManager.TryAcquireLock("foo.txt.lock", ref lockFile);

            Assert.That(granted, Is.True);
            Assert.That(lockFile, Is.Not.Null);
            Assert.That(_lockFileManager.IsLocked("foo.txt.lock"), Is.True);
            Assert.That(_appDataFolder.ListFiles("").Count(), Is.EqualTo(1));
        }