Exemple #1
0
        public async Task OtherRequirementDefinitionExistsWithSameTitleAsync_WhenNewTitle_ShouldReturnFalse()
        {
            using (var context = new PreservationContext(_dbContextOptions, _plantProvider, _eventDispatcher, _currentUserProvider))
            {
                var fieldTypes = new List <FieldType>();
                var dut        = new RequirementTypeValidator(context);
                var result     = await dut.OtherRequirementDefinitionExistsWithSameTitleAsync(_reqTypeId1, _reqDefId1_2, "XXXXXY", fieldTypes, default);

                Assert.IsFalse(result);
            }
        }
Exemple #2
0
        public async Task OtherRequirementDefinitionExistsWithSameTitleAsync_WhenSameTitleInOtherDefinition_ButNeedUserInputDiffer_ShouldReturnFalse()
        {
            using (var context = new PreservationContext(_dbContextOptions, _plantProvider, _eventDispatcher, _currentUserProvider))
            {
                var fieldTypes = new List <FieldType> {
                    FieldType.Attachment
                };
                var dut    = new RequirementTypeValidator(context);
                var result = await dut.OtherRequirementDefinitionExistsWithSameTitleAsync(_reqTypeId1, _reqDefId1_2, _reqDefTitle1_1, fieldTypes, default);

                Assert.IsFalse(result);
            }
        }