public void NonPositive_NullablePostconditionMethod_DoesNotThrowIfNull() { var demo = new NonPositiveConsumer(); Assert.DoesNotThrow(() => demo.PostconditionNullableMethod(null)); }
public void NonPositive_NullablePostconditionMethod_ThrowsIfPositive() { var demo = new NonPositiveConsumer(); Assert.Throws <PostconditionException>(() => demo.PostconditionNullableMethod(1)); }
public void NonPositive_MultiplePreconditionsMethod_DoesNotThrowIfArgsNonPositive() { var demo = new NonPositiveConsumer(); Assert.DoesNotThrow(() => demo.MultiplePreconditionsMethod(-1, 0)); }
public void NonPositive_NullablePreconditionMethod_DoesNotThrowIfNegative() { var demo = new NonPositiveConsumer(); Assert.DoesNotThrow(() => demo.PreconditionNullableMethod(-1)); }
public void NonPositive_PreAndPostconditionMethod_ThrowsIfArgPositive() { var demo = new NonPositiveConsumer(); Assert.Throws <PreconditionException>(() => demo.PreAndPostconditionMethod(1)); }
public void NonPositive_PreAndPostconditionMethod_DoesNotThrowIfArgAndResultNegative() { var demo = new NonPositiveConsumer(); Assert.DoesNotThrow(() => demo.PreAndPostconditionMethod(-1)); }
public void NonPositive_PostconditionMethod_DoesNotThrowIf0() { var demo = new NonPositiveConsumer(); Assert.DoesNotThrow(() => demo.PostconditionMethod(0)); }
public void NonPositive_NormalMethod_DoesNotThrow() { var demo = new NonPositiveConsumer(); Assert.DoesNotThrow(() => demo.NormalMethod()); }
public void NonPositive_ContractReadWriteProperty_SetThrowsIfPositive() { var demo = new NonPositiveConsumer(); Assert.Throws <PreconditionException>(() => { demo.ContractReadWriteProperty = 1; }); }
public void NonPositive_ContractReadWriteProperty_SetDoesNotThrowIf0() { var demo = new NonPositiveConsumer(); Assert.DoesNotThrow(() => { demo.ContractReadWriteProperty = 0; }); }
public void NonPositive_NormalProperty_SetDoesNotThrow() { var demo = new NonPositiveConsumer(); Assert.DoesNotThrow(() => { demo.NormalReadWriteProperty = 0; }); }
public void NonPositive_PreAndPostconditionMethod_ThrowsIfResultPositive() { var demo = new NonPositiveConsumer(); Func <string> textGenerator = () => null; Assert.Throws <PostconditionException>(() => demo.PreAndPostconditionMethod(0)); }
public void NonPositive_ContractReadWriteProperty_GetThrowsIfPositive() { var demo = new NonPositiveConsumer(); demo._readWritePropertyWithContract = 1; Assert.Throws <PostconditionException>(() => { var x = demo.ContractReadWriteProperty; }); }
public void NonPositive_ContractReadWriteProperty_GetDoesNotThrowIf0() { var demo = new NonPositiveConsumer(); demo._readWritePropertyWithContract = 0; Assert.DoesNotThrow(() => { var x = demo.ContractReadWriteProperty; }); }
public void NonPositive_MultiplePreconditionsMethod_ThrowsIfAnyArgPositive() { var demo = new NonPositiveConsumer(); Assert.Throws <PreconditionException>(() => demo.MultiplePreconditionsMethod(1, 0)); Assert.Throws <PreconditionException>(() => demo.MultiplePreconditionsMethod(0, 1)); }