EmptyConstraint - jnm2/nunit-docs-wiki GitHub Wiki
EmptyConstraint tests that an object is an empty string, directory or collection.
EmptyConstraint()
Is.Empty
Assert.That(aString, Is.Empty);
Assert.That(dirInfo, Is.Empty);
Assert.That(collection, Is.Empty);
- EmptyConstraint creates and uses either an EmptyStringConstraint, EmptyDirectoryConstraint or EmptyCollectionConstraint depending on the argument tested.
- A
DirectoryInfo
argument is required in order to test for an empty directory. To test whether a string represents a directory path, you must first construct aDirectoryInfo
.