示例#1
0
        public void ToString_ReturnsStringRepresentationOfPostcode(string input, PostcodeParseOptions options,
                                                                   string expectedToString)
        {
            // Arrange
            Postcode postcode = Postcode.Parse(input, options);

            // Act
            string actualToString = postcode.ToString();

            // Assert
            Assert.That(actualToString, Is.EqualTo(expectedToString));
        }
 public void Postcode_Test()
 {
     foreach (var test in GetTestData())
     {
         var postcode = new Postcode(test.Postcode);
         Assert.AreEqual(test.OutwardCode, postcode.OutwardCode);
         Assert.AreEqual(test.Area, postcode.Area);
         Assert.AreEqual(test.District, postcode.District);
         Assert.AreEqual(test.InwardCode, postcode.InwardCode);
         Assert.AreEqual(test.Sector, postcode.Sector);
         Assert.AreEqual(test.Unit, postcode.Unit);
         Assert.AreEqual(test.IsValid, postcode.IsValid);
         Assert.AreEqual(test.Normalized, postcode.ToString());
     }
 }
示例#3
0
 public override string ToString() =>
 Postcode.ToString();