public void FiveDigitPostalCodeThatDoesntEndWithZeroSpecification() { var specification = new PostOfficeBoxPostalCodeSpecification(); Assert.IsTrue(specification.IsSatisfiedBy(ValidPostalCode)); Assert.IsTrue(string.IsNullOrWhiteSpace(specification.GetReasonsForDissatisfactionSeparatedWithNewLine())); }
public new static bool TryCreate(string postalCode, out PostalCode result, out string failureReason) { var specification = new PostOfficeBoxPostalCodeSpecification(); if (specification.IsSatisfiedBy(postalCode)) { result = new PostOfficeBoxPostalCode(postalCode); failureReason = string.Empty; return true; } result = null; failureReason = specification.GetReasonsForDissatisfactionSeparatedWithNewLine(); return false; }
private static void AssertFailedSpecification(string postalCode) { var specification = new PostOfficeBoxPostalCodeSpecification(); Assert.IsFalse(specification.IsSatisfiedBy(postalCode)); Assert.IsFalse(string.IsNullOrWhiteSpace(specification.GetReasonsForDissatisfactionSeparatedWithNewLine())); }