public void IfArgumentEqual([Values(0)] int argument) { // ACT var exception = Assert.Throws <DesignByContractViolationException>( () => Fail.IfArgumentEqual(argument, argument, nameof(argument)) ); // ASSERT Assert.That(exception.Message, Is.EqualTo("Argument 'argument' is equal to 0 and it should NOT be.")); }
public void IfArgumentEqual(Pair obj) { // ACT var exception = Assert.Throws <DesignByContractViolationException>( () => Fail.IfArgumentEqual(obj.Value1, obj.Value2, nameof(obj)) ); // ASSERT Assert.That(exception.Message, Is.EqualTo("Argument 'obj' is equal to " + obj.GetValue2() + " and it should NOT be.")); }
public void IfArgumentEqualSuccess([Values(1)] int argument) { // ACT Fail.IfArgumentEqual(argument - 1, argument, nameof(argument)); }
public void IfArgumentEqualSuccess(Pair obj) { // ACT Fail.IfArgumentEqual(obj.Value1, obj.Value2, nameof(obj)); }