public void IfNull_WithTarget_DoNotCallAction_ReturnSameTypeNull() { var target = new MockClass1(); MockClass1 rtn = target.IfNull(() => new MockClass1()); Assert.AreSame(rtn, target); }
public void IfNull_WithTarget_DoNotCallFuncTR_ReturnOtherTypeNull() { var target = new MockClass1(); MockClass2 rtn = target.IfNull(() => new MockClass2()); Assert.IsNull(rtn); }
public void IfNull_WithTarget_CallAction_ReturnTarget() { var target = new MockClass1(); // If T is null, call Action, always return T var rtn = target.IfNull(() => Assert.Fail()); Assert.AreSame(rtn, target); }