public void ServiceLockingTest() { var lockManager = new LockingManager(contextManager, userIdentificationMock); var service = servicesDbSet.First(); var lockResult = lockManager.LockEntity(service); Assert.Equal("TestUser", lockResult.LockedBy); Assert.Equal(EntityLockEnum.LockedForCurrent, lockResult.LockStatus); Assert.False(lockManager.IsLocked(service)); userIdentificationMockSetup.Setup(ui => ui.UserName).Returns("TestUserAnother"); Assert.True(lockManager.IsLocked(service)); }