public void NonNegative_PreAndPostconditionMethod_DoesNotThrowIfArgAndResultPositive() { var demo = new NonNegativeConsumer(); Assert.DoesNotThrow(() => demo.PreAndPostconditionMethod(1)); }
public void NonNegative_MultiplePreconditionsMethod_DoesNotThrowIfArgsNonNegative() { var demo = new NonNegativeConsumer(); Assert.DoesNotThrow(() => demo.MultiplePreconditionsMethod(1, 0)); }
public void NonNegative_PreAndPostconditionMethod_ThrowsIfArgNegative() { var demo = new NonNegativeConsumer(); Assert.Throws <PreconditionException>(() => demo.PreAndPostconditionMethod(-1)); }
public void NonNegative_PostconditionMethod_DoesNotThrowIf0() { var demo = new NonNegativeConsumer(); Assert.DoesNotThrow(() => demo.PostconditionMethod(0)); }
public void NonNegative_NormalMethod_DoesNotThrow() { var demo = new NonNegativeConsumer(); Assert.DoesNotThrow(() => demo.NormalMethod()); }
public void NonNegative_NullablePostconditionMethod_ThrowsIfNegative() { var demo = new NonNegativeConsumer(); Assert.Throws <PostconditionException>(() => demo.PostconditionNullableMethod(-1)); }
public void NonNegative_NullablePostconditionMethod_DoesNotThrowIfNull() { var demo = new NonNegativeConsumer(); Assert.DoesNotThrow(() => demo.PostconditionNullableMethod(null)); }
public void NonNegative_NullablePreconditionMethod_DoesNotThrowIfPositive() { var demo = new NonNegativeConsumer(); Assert.DoesNotThrow(() => demo.PreconditionNullableMethod(1)); }
public void NonNegative_ContractReadWriteProperty_SetThrowsIfNegative() { var demo = new NonNegativeConsumer(); Assert.Throws <PreconditionException>(() => { demo.ContractReadWriteProperty = -1; }); }
public void NonNegative_ContractReadWriteProperty_SetDoesNotThrowIf0() { var demo = new NonNegativeConsumer(); Assert.DoesNotThrow(() => { demo.ContractReadWriteProperty = 0; }); }
public void NonNegative_NormalProperty_SetDoesNotThrow() { var demo = new NonNegativeConsumer(); Assert.DoesNotThrow(() => { demo.NormalReadWriteProperty = 0; }); }
public void NonNegative_PreAndPostconditionMethod_ThrowsIfResultNegative() { var demo = new NonNegativeConsumer(); Func <string> textGenerator = () => null; Assert.Throws <PostconditionException>(() => demo.PreAndPostconditionMethod(0)); }
public void NonNegative_ContractReadWriteProperty_GetThrowsIfNegative() { var demo = new NonNegativeConsumer(); demo._readWritePropertyWithContract = -1; Assert.Throws <PostconditionException>(() => { var x = demo.ContractReadWriteProperty; }); }
public void NonNegative_ContractReadWriteProperty_GetDoesNotThrowIf0() { var demo = new NonNegativeConsumer(); demo._readWritePropertyWithContract = 0; Assert.DoesNotThrow(() => { var x = demo.ContractReadWriteProperty; }); }
public void NonNegative_MultiplePreconditionsMethod_ThrowsIfAnyArgNegative() { var demo = new NonNegativeConsumer(); Assert.Throws <PreconditionException>(() => demo.MultiplePreconditionsMethod(-1, 0)); Assert.Throws <PreconditionException>(() => demo.MultiplePreconditionsMethod(0, -1)); }