public void Negative_NullablePostconditionMethod_ThrowsIfPosiitive() { var demo = new NegativeConsumer(); Assert.Throws <PostconditionException>(() => demo.PostconditionNullableMethod(1)); }
public void Negative_NullablePreconditionMethod_ThrowsIf0() { var demo = new NegativeConsumer(); Assert.Throws <PreconditionException>(() => demo.PreconditionNullableMethod(0)); }
public void Negative_NullablePostconditionMethod_DoesNotThrowIfNull() { var demo = new NegativeConsumer(); Assert.DoesNotThrow(() => demo.PostconditionNullableMethod(null)); }
public void Negative_PreAndPostconditionMethod_ThrowsIfArgPositive() { var demo = new NegativeConsumer(); Assert.Throws <PreconditionException>(() => demo.PreAndPostconditionMethod(100)); }
public void Negative_MultiplePreconditionsMethod_DoesNotThrowIfArgsNegative() { var demo = new NegativeConsumer(); Assert.DoesNotThrow(() => demo.MultiplePreconditionsMethod(-1, -3.14)); }
public void Negative_PreAndPostconditionMethod_DoesNotThrowIfArgAndResultNegative() { var demo = new NegativeConsumer(); Assert.DoesNotThrow(() => demo.PreAndPostconditionMethod(-100)); }
public void Negative_PostconditionMethod_ThrowsIf0() { var demo = new NegativeConsumer(); Assert.Throws <PostconditionException>(() => demo.PostconditionMethod(0)); }
public void Negative_PostconditionMethod_DoesNotThrowIfNegative() { var demo = new NegativeConsumer(); Assert.DoesNotThrow(() => demo.PostconditionMethod(-1)); }
public void Negative_NormalMethod_DoesNotThrow() { var demo = new NegativeConsumer(); Assert.DoesNotThrow(() => demo.NormalMethod()); }
public void Negative_ContractReadWriteProperty_SetThrowsIfPositive() { var demo = new NegativeConsumer(); Assert.Throws <PreconditionException>(() => { demo.ContractReadWriteProperty = 1; }); }
public void Negative_ContractReadWriteProperty_SetDoesNotThrowIfNegative() { var demo = new NegativeConsumer(); Assert.DoesNotThrow(() => { demo.ContractReadWriteProperty = -1; }); }
public void Negative_NormalProperty_SetDoesNotThrow() { var demo = new NegativeConsumer(); Assert.DoesNotThrow(() => { demo.NormalReadWriteProperty = 0; }); }
public void Negative_PreAndPostconditionMethod_ThrowsIfResult0() { var demo = new NegativeConsumer(); Func <string> textGenerator = () => null; Assert.Throws <PostconditionException>(() => demo.PreAndPostconditionMethod(-1)); }
public void Negative_ContractReadWriteProperty_GetThrowsIfPositive() { var demo = new NegativeConsumer(); demo._readWritePropertyWithContract = 1; Assert.Throws <PostconditionException>(() => { var x = demo.ContractReadWriteProperty; }); }
public void Negative_ContractReadWriteProperty_GetDoesNotThrowIfNegative() { var demo = new NegativeConsumer(); demo._readWritePropertyWithContract = -1; Assert.DoesNotThrow(() => { var x = demo.ContractReadWriteProperty; }); }
public void Negative_MultiplePreconditionsMethod_ThrowsIfAnyArgPositive() { var demo = new NegativeConsumer(); Assert.Throws <PreconditionException>(() => demo.MultiplePreconditionsMethod(1, -1)); Assert.Throws <PreconditionException>(() => demo.MultiplePreconditionsMethod(-1, 1)); }