예제 #1
0
        public async Task HasAnyForSupplierOnlyUsageAsync_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.HasAnyForSupplierOnlyUsageAsync(reqIds, default);

                Assert.IsFalse(result);
            }
        }
예제 #2
0
        public async Task HasAnyForSupplierOnlyUsageAsync_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.HasAnyForSupplierOnlyUsageAsync(reqIds, default);

                Assert.IsTrue(result);
            }
        }