Property constraints are used to test for the existence of a named property and optionally to test its value. It may also be used as a prefix for other constraints to be applied to the property.
Tests for the existence of a named property on an object.
PropertyExistsConstraint(string name)
Has.Property( string )
Assert.That( someObject, Has.Property( "Version" ) );
Tests for the existence of a named property on an object and causes subsequent allows tests to be made on the property value.
PropertyConstraint(string name)
Has.Property(string)...
Assert.That(someObject, Has.Property("Version").EqualTo("2.0")); Assert.That(collection, Has.Property("Count").GreaterThan(10));
Certain common properties are known to NUnit and may be tested using the following syntax...
Has.Length... Has.Count... Has.Message... Has.InnerException...