public void CanValidateNullShouldThrow() { IValueValidator urnValidator = new UrnValidator(); // ReSharper disable once AssignNullToNotNullAttribute Assert.Throws <ArgumentException>(() => { urnValidator.CanValidate(null !); }); }
public void ValidateValidUrnShouldProduceNoErrors() { IValueValidator urnValidator = new UrnValidator(); ImmutableArray <ValidationError> validationErrors = urnValidator.Validate("urn", "urn:test:abc"); Assert.Empty(validationErrors); }
public void ItShouldValidateNullStringAsInvalid() { IValueValidator urnValidator = new UrnValidator(); ImmutableArray <ValidationError> validationErrors = urnValidator.Validate("urn", null); Assert.Single(validationErrors); }
public void CanValidateUrnShouldReturnTrue() { IValueValidator urnValidator = new UrnValidator(); bool canValidate = urnValidator.CanValidate("urn"); Assert.True(canValidate); }
public void ValidateValidUrnWithWrongTypeShouldProduceNoErrors() { IValueValidator urnValidator = new UrnValidator(); Assert.Throws <InvalidOperationException>(() => { urnValidator.Validate("bool", "urn:abc"); }); }
public void CanValidateEmptyShouldThrow() { IValueValidator urnValidator = new UrnValidator(); Assert.Throws <ArgumentException>(() => { urnValidator.CanValidate(""); }); }