public void Should_properly_return_on_method() { var thing = new Thing(numOtherThings: 2); var result = thing.AndAnd(t => t.OtherThing.GetOtherThing()); Assert.That(result == thing.OtherThing.GetOtherThing()); }
public void Should_handle_null_method_result() { var thing = new Thing(); var result = thing.AndAnd(t => t.GetOtherThing().OtherThing); Assert.That(result == null); }
public void Should_handle_null_property() { var thing = new Thing(); var result = thing.AndAnd(t => t.OtherThing.OtherThing); Assert.That(result == null); }
private Thing(int thingNumber, int numberOtherThings) { ThingNumber = thingNumber; if (numberOtherThings > 0) { OtherThingField = new Thing(thingNumber + 1, numberOtherThings - 1); } }