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() ); } }
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()); } }
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 >"; }
/// <summary> /// Construct a CollectionSubsetConstraint /// </summary> /// <param name="expected"></param> public SubsetOfConstraint(IEnumerable<string> expected) : base(expected) { InternalConstraint = new CollectionSubsetConstraint(expected); }
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 >"; }
/// <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()); }