public void IfOnObjectWithValue() { var source = new { Property = 5 }; Assert.AreEqual(source, source.If(s => s.Property > 3)); Assert.AreEqual(null, source.If(s => s.Property > 6)); }
public void IfOnObjectWithNull() { var source = new { Property = 5 }; source = null; Assert.IsNull(source.If(s => s.Property > 3)); Assert.IsNull(source.If(s => s.Property > 6)); }