protected void Validate(Contractor contractor) { NipValidator.Validate(contractor.NIP); RegonValidator.Validate(contractor.REGON); if (string.IsNullOrWhiteSpace(contractor.Name)) { throw new MissingContractorNameException(); } if (string.IsNullOrWhiteSpace(contractor.Address)) { throw new MissingContractorAddressException(); } }
public void IsValid_ValidRegonsTest(string regon) { Assert.True(RegonValidator.IsValid(regon)); }
public void IsValid_TooLongRegonsTest(string regon) { Assert.False(RegonValidator.IsValid(regon)); }
public void IsValid_MonkeyInvalidRegonsTest(string regon) { Assert.False(RegonValidator.IsValid(regon)); }