コード例 #1
0
        public async Task TagFunctionRequirementsExistAsync_NoTagFunctionRequirements_ShouldReturnFalse()
        {
            using (var context = new PreservationContext(_dbContextOptions, _plantProvider, _eventDispatcher, _currentUserProvider))
            {
                var dut    = new RequirementDefinitionValidator(context);
                var result = await dut.TagFunctionRequirementsExistAsync(_reqDefWithoutField.Id, default);

                Assert.IsFalse(result);
            }
        }
コード例 #2
0
        public async Task TagFunctionRequirementsExistAsync_TagFunctionRequirementsExists_ShouldReturnTrue()
        {
            using (var context = new PreservationContext(_dbContextOptions, _plantProvider, _eventDispatcher, _currentUserProvider))
            {
                var tf = AddTagFunction(context, "M", "R");
                tf.AddRequirement(new TagFunctionRequirement(TestPlant, 4, _reqDefWithoutField));
                context.SaveChangesAsync().Wait();
            }

            using (var context = new PreservationContext(_dbContextOptions, _plantProvider, _eventDispatcher, _currentUserProvider))
            {
                var dut    = new RequirementDefinitionValidator(context);
                var result = await dut.TagFunctionRequirementsExistAsync(_reqDefWithoutField.Id, default);

                Assert.IsTrue(result);
            }
        }