Esempio n. 1
0
        public async Task HasAnyForForOtherThanSuppliersUsageAsync_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.HasAnyForForOtherThanSuppliersUsageAsync(reqIds, default);

                Assert.IsFalse(result);
            }
        }
Esempio n. 2
0
        public async Task HasAnyForForOtherThanSuppliersUsageAsync_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.HasAnyForForOtherThanSuppliersUsageAsync(reqIds, default);

                Assert.IsTrue(result);
            }
        }