public void TryParse_Y2000W53D7_DefaultValue() { WeekDate exp = default(WeekDate); WeekDate act; Assert.IsFalse(WeekDate.TryParse("2000-W53-7", out act)); Assert.AreEqual(exp, act); }
public void TyrParse_Null_IsInvalid() { WeekDate val; string str = null; Assert.IsFalse(WeekDate.TryParse(str, out val), "Not valid"); }
public void TryParse_Y0000W21D7_DefaultValue() { WeekDate exp = default; Assert.IsFalse(WeekDate.TryParse("0000-W21-7", out WeekDate act)); Assert.AreEqual(exp, act); }
public void TyrParse_StringValue_IsValid() { string str = "1234-W50-6"; Assert.IsTrue(WeekDate.TryParse(str, out WeekDate val), "Valid"); Assert.AreEqual(str, val.ToString(), "Value"); }
public void TyrParse_StringValue_IsNotValid() { WeekDate val; string str = "string"; Assert.IsFalse(WeekDate.TryParse(str, out val), "Valid"); }
public void TyrParse_StringEmpty_IsInvalid() { WeekDate val; string str = string.Empty; Assert.IsFalse(WeekDate.TryParse(str, out val), "Not valid"); }
public void TryParse_InvalidInput_DefaultValue() { using (new CultureInfoScope("en-GB")) { var exp = default(WeekDate); var act = WeekDate.TryParse("InvalidInput"); Assert.AreEqual(exp, act); } }
public void TryParse_TestStructInput_AreEqual() { using (new CultureInfoScope("en-GB")) { var exp = TestStruct; var act = WeekDate.TryParse(exp.ToString()); Assert.AreEqual(exp, act); } }
public void TyrParse_StringValue_IsNotValid() { Assert.IsFalse(WeekDate.TryParse("string", out _), "Valid"); }
public void TyrParse_StringEmpty_IsInvalid() { Assert.IsFalse(WeekDate.TryParse(string.Empty, out _), "Not valid"); }