public void NonNegative_PreAndPostconditionMethod_ThrowsIfArgNegative() { var demo = new NonNegativeConsumer(); Assert.Throws <PreconditionException>(() => demo.PreAndPostconditionMethod(-1)); }
public void NonNegative_PreAndPostconditionMethod_DoesNotThrowIfArgAndResultPositive() { var demo = new NonNegativeConsumer(); Assert.DoesNotThrow(() => demo.PreAndPostconditionMethod(1)); }
public void NonNegative_PreAndPostconditionMethod_ThrowsIfResultNegative() { var demo = new NonNegativeConsumer(); Func <string> textGenerator = () => null; Assert.Throws <PostconditionException>(() => demo.PreAndPostconditionMethod(0)); }