Exemple #1
0
        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."));
        }
Exemple #2
0
        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."));
        }
Exemple #3
0
 public void IfArgumentEqualSuccess([Values(1)] int argument)
 {
     // ACT
     Fail.IfArgumentEqual(argument - 1, argument, nameof(argument));
 }
Exemple #4
0
 public void IfArgumentEqualSuccess(Pair obj)
 {
     // ACT
     Fail.IfArgumentEqual(obj.Value1, obj.Value2, nameof(obj));
 }