Exemplo n.º 1
0
        public void ServiceLockingAndRelockingTest()
        {
            var lockManager = new LockingManager(contextManager, userIdentificationMock);
            var service     = servicesDbSet.First();

            lockManager.LockEntity(service);
            userIdentificationMockSetup.Setup(ui => ui.UserName).Returns("TestUserAnother");
            var lockResult = lockManager.LockEntity(service);

            Assert.Equal(EntityLockEnum.LockedForAnother, lockResult.LockStatus);
            Assert.Equal("TestUser", lockResult.LockedBy);
        }
Exemplo n.º 2
0
        public void ServiceLockingUnlockingTest()
        {
            var lockManager = new LockingManager(contextManager, userIdentificationMock);
            var service     = servicesDbSet.First();

            lockManager.LockEntity(service);
            var lockResult = lockManager.UnLockEntity(service);

            Assert.Equal(EntityLockEnum.Unlocked, lockResult);
        }