Beispiel #1
0
 /// <summary>
 /// Returns a new AttributeConstraint checking for the
 /// presence of a particular attribute on an object.
 /// </summary>
 public ResolvableConstraintExpression Attribute(Type expectedType)
 {
     return(Has.Attribute(expectedType));
 }
Beispiel #2
0
 /// <summary>
 /// Returns a ConstraintExpression, which will apply
 /// the following constraint to all members of a collection,
 /// succeeding only if a specified number of them succeed.
 /// </summary>
 public static ItemsConstraintExpression Exactly(int expectedCount)
 {
     return(Has.Exactly(expectedCount));
 }
Beispiel #3
0
 /// <summary>
 /// Returns a new PropertyConstraintExpression, which will either
 /// test for the existence of the named property on the object
 /// being tested or apply any following constraint to that property.
 /// </summary>
 public ResolvableConstraintExpression Property(string name)
 {
     return(Has.Property(name));
 }
Beispiel #4
0
 /// <summary>
 /// Asserts that collection contains actual as an item.
 /// </summary>
 /// <param name="collection">IEnumerable of objects to be considered</param>
 /// <param name="actual">Object to be found within collection</param>
 /// <param name="message">The message that will be displayed on failure</param>
 /// <param name="args">Arguments to be used in formatting the message</param>
 public static void Contains(IEnumerable collection, Object actual, string message, params object[] args)
 {
     Assert.That(collection, Has.Member(actual), message, args);
 }