public void Returns_Itself_For_Null_Targets() { var ignore = new IgnoreNull(null); Assert.AreEqual(ignore, ignore.QuackGet(null, null)); Assert.AreEqual(ignore, ignore.QuackSet(null, null, null)); Assert.AreEqual(ignore, ignore.QuackInvoke(null, null)); }
public void Wraps_Result_In_IgnoreNull() { var ignore = new IgnoreNull(new Duck()); Assert.IsInstanceOf <IgnoreNull>(ignore.QuackGet("Name", null)); Assert.IsInstanceOf <IgnoreNull>(ignore.QuackSet("Name", null, "Donald")); Assert.IsInstanceOf <IgnoreNull>(ignore.QuackInvoke("ToString", null)); Assert.AreEqual(true, ignore.QuackGet("_IsIgnoreNullReferencingNotNullObject_", null)); }