public void WorksOnTuples()
        {
            var actual = new[] { Tuple.Create('a', 1), Tuple.Create('b', 2), Tuple.Create('c', 3), Tuple.Create('d', 4) };
            var expected = new[] { Tuple.Create('b', 2), Tuple.Create('c', 3) };

            var constraint = new CollectionSupersetConstraint(expected);
            var constraintResult = constraint.ApplyTo(actual);

            Assert.That(constraintResult.IsSuccess, Is.True);
        }
 public void HonorsIgnoreCase( IEnumerable expected, IEnumerable actual )
 {
     var constraint = new CollectionSupersetConstraint( expected ).IgnoreCase;
     var constraintResult = constraint.ApplyTo( actual );
     if ( !constraintResult.IsSuccess )
     {
         MessageWriter writer = new TextMessageWriter();
         constraintResult.WriteMessageTo( writer );
         Assert.Fail( writer.ToString() );
     }
 }
 public void HonorsIgnoreCase(IEnumerable expected, IEnumerable actual)
 {
     var constraint = new CollectionSupersetConstraint(expected).IgnoreCase;
     var constraintResult = constraint.ApplyTo(actual);
     if (!constraintResult.IsSuccess)
     {
         MessageWriter writer = new TextMessageWriter();
         constraintResult.WriteMessageTo(writer);
         Assert.Fail(writer.ToString());
     }
 }
        public void WorksOnTuples_OneTypeIsntIComparer()
        {
            var a = new S { C = 'a' };
            var b = new S { C = 'b' };
            var c = new S { C = 'c' };
            var d = new S { C = 'd' };

            var actual = new[] { Tuple.Create(a, 1), Tuple.Create(b, 2), Tuple.Create(c, 3), Tuple.Create(d, 4) };
            var expected = new[] { Tuple.Create(b, 2), Tuple.Create(c, 3) };

            var constraint = new CollectionSupersetConstraint(expected);
            var constraintResult = constraint.ApplyTo(actual);

            Assert.That(constraintResult.IsSuccess, Is.True);
        }
 public void SetUp()
 {
     theConstraint        = new CollectionSupersetConstraint(new int[] { 1, 2, 3, 4, 5 });
     stringRepresentation = "<supersetof System.Int32[]>";
     expectedDescription  = "superset of < 1, 2, 3, 4, 5 >";
 }
 public void SetUp()
 {
     theConstraint = new CollectionSupersetConstraint(new int[] { 1, 2, 3, 4, 5 });
     stringRepresentation = "<supersetof System.Int32[]>";
     expectedDescription = "superset of < 1, 2, 3, 4, 5 >";
 }