Esempio n. 1
0
        public void ModelIsNull()
        {
            // Arrange
            var validator = new OrganizationIdValidator(null, commonService);

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

            // Assert
            controller.ModelState.IsValid.Should().BeTrue();
        }
Esempio n. 2
0
        public void ModelSetAndOrganizationNotExists()
        {
            // Arrange
            commonServiceMockSetup.Setup(c => c.OrganizationExists(It.IsAny <Guid>(), PublishingStatus.Published)).Returns(false);
            var validator = new OrganizationIdValidator(Guid.NewGuid().ToString(), commonService);

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

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