コード例 #1
0
        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());
        }
コード例 #2
0
        public void Should_handle_null_method_result()
        {
            var thing = new Thing();

            var result = thing.AndAnd(t => t.GetOtherThing().OtherThing);

            Assert.That(result == null);
        }
コード例 #3
0
        public void Should_handle_null_property()
        {
            var thing = new Thing();

            var result = thing.AndAnd(t => t.OtherThing.OtherThing);

            Assert.That(result == null);
        }
コード例 #4
0
 private Thing(int thingNumber, int numberOtherThings)
 {
     ThingNumber = thingNumber;
     if (numberOtherThings > 0)
     {
         OtherThingField = new Thing(thingNumber + 1, numberOtherThings - 1);
     }
 }