public async Task ShouldNotThrowException_UnlockedRegister() { // Arrange var mockedContext = GetApplicationDbContext(); var service = new LockEntityService(mockedContext); // Act await service.CheckLock <Customer>(UnlockedCustomerId, UnlockedUser); // Assert Assert.IsTrue(true); }
public async Task ShouldThrowException() { Exception expectedException = null; // Arrange var mockedContext = GetApplicationDbContext(); var service = new LockEntityService(mockedContext); // Act try { await service.CheckLock <Customer>(LockedCustomerId, UnlockedUser); } catch (Exception ex) { expectedException = ex; } // Assert Assert.IsInstanceOfType(expectedException, typeof(LockEntityException)); }