Exemple #1
0
        public async Task IsVoidedAsync_UnknownId_ShouldReturnFalse()
        {
            using (var context = new PreservationContext(_dbContextOptions, _plantProvider, _eventDispatcher, _currentUserProvider))
            {
                var dut    = new RequirementTypeValidator(context);
                var result = await dut.IsVoidedAsync(126234, default);

                Assert.IsFalse(result);
            }
        }
Exemple #2
0
        public async Task IsVoidedAsync_KnownVoided_ShouldReturnTrue()
        {
            using (var context = new PreservationContext(_dbContextOptions, _plantProvider, _eventDispatcher, _currentUserProvider))
            {
                var reqType = context.RequirementTypes.Single(rd => rd.Id == _reqTypeId1);
                reqType.IsVoided = true;
                context.SaveChangesAsync().Wait();
            }
            using (var context = new PreservationContext(_dbContextOptions, _plantProvider, _eventDispatcher, _currentUserProvider))
            {
                var dut    = new RequirementTypeValidator(context);
                var result = await dut.IsVoidedAsync(_reqTypeId1, default);

                Assert.IsTrue(result);
            }
        }