public void TyrParse_StringValue_IsNotValid() { string str = "string"; Assert.IsFalse(HouseNumber.TryParse(str, out HouseNumber val), "Valid"); Assert.AreEqual(string.Empty, val.ToString(), "Value"); }
public void TyrParse_StringValue_IsValid() { string str = "123"; Assert.IsTrue(HouseNumber.TryParse(str, out HouseNumber val), "Valid"); Assert.AreEqual(str, val.ToString(), "Value"); }
public void TyrParse_Questionmark_IsValid() { string str = "?"; Assert.IsTrue(HouseNumber.TryParse(str, out HouseNumber val), "Valid"); Assert.IsTrue(val.IsUnknown(), "Value"); }
public void TyrParse_Null_IsValid() { string str = null; Assert.IsTrue(HouseNumber.TryParse(str, out HouseNumber val), "Valid"); Assert.AreEqual(string.Empty, val.ToString(), "Value"); }
public void TyrParse_StringEmpty_IsValid() { HouseNumber val; string str = string.Empty; Assert.IsTrue(HouseNumber.TryParse(str, out val), "Valid"); Assert.AreEqual(string.Empty, val.ToString(), "Value"); }
public void TryParse_InvalidInput_DefaultValue() { using (new CultureInfoScope("en-GB")) { var exp = default(HouseNumber); var act = HouseNumber.TryParse("InvalidInput"); Assert.AreEqual(exp, act); } }
public void TryParse_TestStructInput_AreEqual() { using (new CultureInfoScope("en-GB")) { var exp = TestStruct; var act = HouseNumber.TryParse(exp.ToString()); Assert.AreEqual(exp, act); } }