Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- [Test]
- public void EmptyConstraint()
- {
- //EmptyConstraint tests that an object is an empty string,
- //directory or collection.
- //Syntax: Is.Empty
- string aString = String.Empty;
- Assert.That(aString, Is.Empty);
- string path = Environment.CurrentDirectory;
- DirectoryInfo dirInfo = new DirectoryInfo(path + @"\test");
- Assert.That(dirInfo, Is.Empty);
- int[] collection = new int[] { };
- Assert.That(collection, Is.Empty);
- //Notes:
- ///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 a DirectoryInfo.
- }
Add Comment
Please, Sign In to add comment