Exemple #1
0
        public async Task IsVoidedAsync_UnknownId_ShouldReturnFalse()
        {
            using (var context = new PreservationContext(_dbContextOptions, _plantProvider, _eventDispatcher, _currentUserProvider))
            {
                var dut    = new RequirementDefinitionValidator(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 reqDef = context.RequirementDefinitions.Single(rd => rd.Id == _reqDefForAll.Id);
                reqDef.IsVoided = true;
                context.SaveChangesAsync().Wait();
            }
            using (var context = new PreservationContext(_dbContextOptions, _plantProvider, _eventDispatcher, _currentUserProvider))
            {
                var dut    = new RequirementDefinitionValidator(context);
                var result = await dut.IsVoidedAsync(_reqDefForAll.Id, default);

                Assert.IsTrue(result);
            }
        }