Exemple #1
0
        public async Task AnyRequirementDefinitionExistsWithSameTitleAsync_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.AnyRequirementDefinitionExistsWithSameTitleAsync(_reqTypeId1, "XXXXXY", fieldTypes, default);

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

                Assert.IsTrue(result);
            }
        }