public void Negative_PreAndPostconditionMethod_ThrowsIfArgPositive() { var demo = new NegativeConsumer(); Assert.Throws <PreconditionException>(() => demo.PreAndPostconditionMethod(100)); }
public void Negative_PreAndPostconditionMethod_DoesNotThrowIfArgAndResultNegative() { var demo = new NegativeConsumer(); Assert.DoesNotThrow(() => demo.PreAndPostconditionMethod(-100)); }
public void Negative_PreAndPostconditionMethod_ThrowsIfResult0() { var demo = new NegativeConsumer(); Func <string> textGenerator = () => null; Assert.Throws <PostconditionException>(() => demo.PreAndPostconditionMethod(-1)); }