public async Task IsClosedAsync_UnknownActionId_ShouldReturnFalse() { using (var context = new PreservationContext(_dbContextOptions, _plantProvider, _eventDispatcher, _currentUserProvider)) { var dut = new ActionValidator(context); var result = await dut.IsClosedAsync(123456, default); Assert.IsFalse(result); } }
public async Task IsClosedAsync_KnownId_ShouldReturnTrue_WhenClosed() { using (var context = new PreservationContext(_dbContextOptions, _plantProvider, _eventDispatcher, _currentUserProvider)) { var action = context.Actions.Single(a => a.Id == _actionId); action.Close(DateTime.UtcNow, context.Persons.Single(p => p.Oid == _currentUserOid)); context.SaveChangesAsync().Wait(); } using (var context = new PreservationContext(_dbContextOptions, _plantProvider, _eventDispatcher, _currentUserProvider)) { var dut = new ActionValidator(context); var result = await dut.IsClosedAsync(_actionId, default); Assert.IsTrue(result); } }