public void ArbitraryPCodesAreValid([Values("TN4", "DN3", "DN17", "DN37", "DN33", "CH5", "M1", "DN 3", "W1P", "EC1A")] string outcode, [Values("9BP", "3AZ", "3DE", "2JT", "3HW")] string incode) { var input = new PostCode(outcode + " " + incode); var actual = input.IsValidUkPostCode(); Assert.That(actual, Is.Not.Null); Assert.That(actual, Is.True); }
public void RandomInvalidPCodesAreFalse([Values("TN4444", " ", "DN 23 33 23", "3", "-", "ABCDEFGHIJKLMNO", "C", "" )] string outcode, [Values("", "AZ", "3D", "2", "C", "9ZZ", " ")] string incode) { var input = new PostCode(outcode + " " + incode); var actual = input.IsValidUkPostCode(); Assert.That(actual, Is.Not.Null); Assert.That(actual, Is.False); }
public void WierdPCodesWork([Values("GIR 0AA", "SW1A 1AA")] string pcode) { var postcode = new PostCode(pcode); var actual = postcode.IsValidUkPostCode(); Assert.That(actual, Is.Not.Null); Assert.That(actual, Is.True); }