public void TestGet() { var user = new User(); var name = Option.Safe(() => user.GetSchool().District.Street.Name); Assert.IsFalse(name.ValidChain()); }
public void TestGet() { var user = new User(); var name = Option.Safe(() => user.GetSchool().District.Street.Name); Assert.IsFalse(name.ValidChain()); }
public void TestNonNullWithMethods() { var user = new User { School = new School { District = new District { Street = new Street { Name = "foo" } } } }; var name = Option.Safe(() => user.GetSchool().GetDistrict().GetStreet().Name); Assert.AreEqual(name.Value, "foo"); }
public void TestNonNullWithMethods() { var user = new User { School = new School { District = new District { Street = new Street { Name = "foo" } } } }; var name = Option.Safe(() => user.GetSchool().GetDistrict().GetStreet().Name); Assert.AreEqual(name.Value, "foo"); }