public void ModelIsNull() { // Arrange var validator = new PrefixNumberValidator(null, codeService); // Act validator.Validate(controller.ModelState); // Assert controller.ModelState.IsValid.Should().BeTrue(); }
public void ModelSetAndLanguageDoesNotExist() { // Arrange codeServiceMockSetup.Setup(c => c.GetDialCode(It.IsAny <string>())).Returns((VmDialCode)null); var validator = new PrefixNumberValidator("number", codeService); // Act validator.Validate(controller.ModelState); // Assert controller.ModelState.IsValid.Should().BeFalse(); }
public void ModelSetAndLanguageExists() { // Arrange codeServiceMockSetup.Setup(c => c.GetDialCode(It.IsAny <string>())).Returns(new VmDialCode() { Id = Guid.NewGuid() }); var validator = new PrefixNumberValidator("number", codeService); // Act validator.Validate(controller.ModelState); // Assert controller.ModelState.IsValid.Should().BeTrue(); }