Exemple #1
0
        public async Task UsageCoversForSuppliersAsync_NoRequirements_ShouldReturnFalse()
        {
            using (var context = new PreservationContext(_dbContextOptions, _plantProvider, _eventDispatcher, _currentUserProvider))
            {
                var reqIds = new List <int>();
                var dut    = new RequirementDefinitionValidator(context);
                var result = await dut.UsageCoversForSuppliersAsync(reqIds, default);

                Assert.IsFalse(result);
            }
        }
Exemple #2
0
        public async Task UsageCoversForSuppliersAsync_UsageForSupplierAndOtherAndForAllRequirement_ShouldReturnTrue()
        {
            using (var context = new PreservationContext(_dbContextOptions, _plantProvider, _eventDispatcher, _currentUserProvider))
            {
                var reqIds = new List <int> {
                    _reqDefForSupplier.Id, _reqDefForOther.Id, _reqDefForAll.Id
                };
                var dut    = new RequirementDefinitionValidator(context);
                var result = await dut.UsageCoversForSuppliersAsync(reqIds, default);

                Assert.IsTrue(result);
            }
        }