コード例 #1
0
        public void Negative_PostconditionMethod_ThrowsIfPositive()
        {
            var demo = new NegativeConsumer();

            Assert.Throws <PostconditionException>(() =>
                                                   demo.PostconditionMethod(1));
        }
コード例 #2
0
        public void Negative_PostconditionMethod_DoesNotThrowIfNegative()
        {
            var demo = new NegativeConsumer();

            Assert.DoesNotThrow(() =>
                                demo.PostconditionMethod(-1));
        }