예제 #1
0
        public void NonNegative_NullablePostconditionMethod_ThrowsIfNegative()
        {
            var demo = new NonNegativeConsumer();

            Assert.Throws <PostconditionException>(() =>
                                                   demo.PostconditionNullableMethod(-1));
        }
예제 #2
0
        public void NonNegative_NullablePostconditionMethod_DoesNotThrowIfNull()
        {
            var demo = new NonNegativeConsumer();

            Assert.DoesNotThrow(() =>
                                demo.PostconditionNullableMethod(null));
        }