-
Notifications
You must be signed in to change notification settings - Fork 158
EmptyCollectionConstraint
jnm2 edited this page Jun 14, 2017
·
5 revisions
The EmptyCollectionConstraint tests if a Collection or other IEnumerable
is empty. An ArgumentException
is thrown if the actual value is not an IEnumerable
or is null.
EmptyCollectionConstraint()
Is.Empty
Assert.That(new int[] { }, Is.Empty);
Assert.That(new int[] { 1, 2, 3 }, Is.Not.Empty);
Note: Is.Empty
actually creates an EmptyConstraint
. Subsequently applying it to an IEnumerable
or ICollection
causes an EmptyCollectionConstraint
to be created.
Copyright (c) 2018 The NUnit Project - Licensed under CC BY-NC-SA 4.0
-
NUnit
-
Release Notes
-
License
- Getting Started
- Writing Tests
- Running Tests
- Extending NUnit
- Technical Notes
-
Release Notes
- NUnit Xamarin Runners
- VS Test Adapter
- VS Test Generator
- NUnit Analyzers