コード例 #1
0
 public void HonorsIgnoreCase( IEnumerable expected, IEnumerable actual )
 {
     var constraint = new CollectionSubsetConstraint( expected ).IgnoreCase;
     var constraintResult = constraint.ApplyTo( actual );
     if ( !constraintResult.IsSuccess )
     {
         MessageWriter writer = new TextMessageWriter();
         constraintResult.WriteMessageTo( writer );
         Assert.Fail( writer.ToString() );
     }
 }
コード例 #2
0
        public void HonorsIgnoreCase(IEnumerable expected, IEnumerable actual)
        {
            var constraint       = new CollectionSubsetConstraint(expected).IgnoreCase;
            var constraintResult = constraint.ApplyTo(actual);

            if (!constraintResult.IsSuccess)
            {
                MessageWriter writer = new TextMessageWriter();
                constraintResult.WriteMessageTo(writer);
                Assert.Fail(writer.ToString());
            }
        }
コード例 #3
0
 public void SetUp()
 {
     theConstraint = new CollectionSubsetConstraint(new int[] { 1, 2, 3, 4, 5 });
     stringRepresentation = "<subsetof System.Int32[]>";
     expectedDescription = "subset of < 1, 2, 3, 4, 5 >";
 }
コード例 #4
0
 public void SetUp()
 {
     theConstraint        = new CollectionSubsetConstraint(new int[] { 1, 2, 3, 4, 5 });
     stringRepresentation = "<subsetof System.Int32[]>";
     expectedDescription  = "subset of < 1, 2, 3, 4, 5 >";
 }
コード例 #5
0
 /// <summary>
 /// Construct a CollectionSubsetConstraint
 /// </summary>
 /// <param name="expected"></param>
 public SubsetOfConstraint(IEnumerable<string> expected)
     : base(expected)
 {
     InternalConstraint = new CollectionSubsetConstraint(expected);
 }
コード例 #6
0
 protected override void SetUp()
 {
     Matcher = new CollectionSubsetConstraint(new int[] { 1, 2, 3, 4, 5 });
     GoodValues = new object[] { new int[] { 1, 3, 5 }, new int[] { 1, 2, 3, 4, 5 } };
     BadValues = new object[] { new int[] { 1, 3, 7 }, new int[] { 1, 2, 2, 2, 5 } };
     Description = "subset of < 1, 2, 3, 4, 5 >";
 }
コード例 #7
0
ファイル: SubsetOfConstraint.cs プロジェクト: zyh329/nbi
 /// <summary>
 /// Construct a CollectionSubsetConstraint
 /// </summary>
 /// <param name="expected"></param>
 public SubsetOfConstraint(IEnumerable<string> expected)
     : base(expected)
 {
     InternalConstraint = new CollectionSubsetConstraint(expected.Select(str => StringComparerHelper.Build(str)).ToList());
 }