Пример #1
0
        public void ModelIsNull()
        {
            // Arrange
            var validator = new OntologyTermListValidator(null, fintoService);

            // Act
            validator.Validate(controller.ModelState);

            // Assert
            controller.ModelState.IsValid.Should().BeTrue();
        }
Пример #2
0
        public void ModelSetAndFintoItemsNotExist()
        {
            // Arrange
            fintoServiceMockSetup.Setup(g => g.GetOntologyTermByUri(It.IsAny <string>())).Returns((IVmOpenApiFintoItemVersionBase)null);
            var validator = new OntologyTermListValidator(list, fintoService);

            // Act
            validator.Validate(controller.ModelState);

            // Assert
            controller.ModelState.IsValid.Should().BeFalse();
        }
Пример #3
0
        public void ModelIncludesNullAndFintoItemsExist()
        {
            // Arrange
            fintoServiceMockSetup.Setup(g => g.GetOntologyTermByUri(It.IsNotNull <string>())).Returns(new VmOpenApiFintoItemVersionBase()
            {
                Id = Guid.NewGuid()
            });
            var validator = new OntologyTermListValidator(list, fintoService);

            // Act
            validator.Validate(controller.ModelState);

            // Assert
            controller.ModelState.IsValid.Should().BeFalse();
        }