示例#1
0
        public void Negative_PreAndPostconditionMethod_ThrowsIfArgPositive()
        {
            var demo = new NegativeConsumer();

            Assert.Throws <PreconditionException>(() =>
                                                  demo.PreAndPostconditionMethod(100));
        }
示例#2
0
        public void Negative_PreAndPostconditionMethod_DoesNotThrowIfArgAndResultNegative()
        {
            var demo = new NegativeConsumer();

            Assert.DoesNotThrow(() =>
                                demo.PreAndPostconditionMethod(-100));
        }
示例#3
0
        public void Negative_PreAndPostconditionMethod_ThrowsIfResult0()
        {
            var           demo          = new NegativeConsumer();
            Func <string> textGenerator = () => null;

            Assert.Throws <PostconditionException>(() =>
                                                   demo.PreAndPostconditionMethod(-1));
        }