0% found this document useful (0 votes)
31 views4 pages

Nunit Methods

The document describes the various methods available in the CollectionAssert and FileAssert classes for validating collections and files in tests. It lists the method signatures for asserting whether collections contain the expected types of items, are unique, equal, equivalent, subsets, ordered, empty or not empty. It also describes methods for asserting equality and inequality of file streams, file info objects and file paths.

Uploaded by

varna.deepak
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
31 views4 pages

Nunit Methods

The document describes the various methods available in the CollectionAssert and FileAssert classes for validating collections and files in tests. It lists the method signatures for asserting whether collections contain the expected types of items, are unique, equal, equivalent, subsets, ordered, empty or not empty. It also describes methods for asserting equality and inequality of file streams, file info objects and file paths.

Uploaded by

varna.deepak
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 4

Collection Assert

CollectionAssert.AllItemsAreInstancesOfType( IEnumerable collection,

Type expectedType );

CollectionAssert.AllItemsAreInstancesOfType( IEnumerable collection,

Type expectedType, string message );

CollectionAssert.AllItemsAreInstancesOfType( IEnumerable collection,

Type expectedType, string message, params object[] args );

CollectionAssert.AllItemsAreNotNull( IEnumerable collection );

CollectionAssert.AllItemsAreNotNull( IEnumerable collection,

string message );

CollectionAssert.AllItemsAreNotNull( IEnumerable collection,

string message, params object[] args );

CollectionAssert.AllItemsAreUnique( IEnumerable collection );

CollectionAssert.AllItemsAreUnique( IEnumerable collection,

string message );

CollectionAssert.AllItemsAreUnique( IEnumerable collection,

string message, params object[] args );

CollectionAssert.AreEqual( IEnumerable expected, IEnumerable actual );

CollectionAssert.AreEqual( IEnumerable expected, IEnumerable actual,

string message );

CollectionAssert.AreEqual( IEnumerable expected, IEnumerable actual

string message, params object[] args );

CollectionAssert.AreEquivalent( IEnumerable expected, IEnumerable actual);

CollectionAssert.AreEquivalent( IEnumerable expected, IEnumerable actual,


string message );

CollectionAssert.AreEquivalent( IEnumerable expected, IEnumerable actual

string message, params object[] args );

CollectionAssert.AreNotEqual( IEnumerable expected, IEnumerable actual );

CollectionAssert.AreNotEqual( IEnumerable expected, IEnumerable actual,

string message );

CollectionAssert.AreNotEqual( IEnumerableon expected, IEnumerable actual

string message, params object[] args );

CollectionAssert.AreNotEquivalent( IEnumerable expected,

IEnumerable actual );

CollectionAssert.AreNotEquivalent( IEnumerable expected,

IEnumerable actual, string message );

CollectionAssert.AreNotEquivalent( IEnumerable expected,

IEnumerable actual, string message, params object[] args );

CollectionAssert.Contains( IEnumerable expected, object actual );

CollectionAssert.Contains( IEnumerable expected, object actual,

string message );

CollectionAssert.Contains( IEnumerable expected, object actual

string message, params object[] args );

CollectionAssert.DoesNotContain( IEnumerable expected, object actual );

CollectionAssert.DoesNotContain( IEnumerable expected, object actual,

string message );

CollectionAssert.DoesNotContain( IEnumerable expected, object actual

string message, params object[] args );


CollectionAssert.IsSubsetOf( IEnumerable subset, IEnumerable superset );

CollectionAssert.IsSubsetOf( IEnumerable subset, IEnumerable superset,

string message );

CollectionAssert.IsSubsetOf( IEnumerable subset, IEnumerable superset,

string message, params object[] args );

CollectionAssert.IsNotSubsetOf( IEnumerable subset, IEnumerable superset);

CollectionAssert.IsNotSubsetOf( IEnumerable subset, IEnumerable superset,

string message );

CollectionAssert.IsNotSubsetOf( IEnumerable subset, IEnumerable superset,

string message, params object[] args );

CollectionAssert.IsEmpty( IEnumerable collection );

CollectionAssert.IsEmpty( IEnumerable collection, string message );

CollectionAssert.IsEmpty( IEnumerable collection, string message,

params object[] args );

CollectionAssert.IsNotEmpty( IEnumerable collection );

CollectionAssert.IsNotEmpty( IEnumerable collection, string message );

CollectionAssert.IsNotEmpty( IEnumerable collection, string message,

params object[] args );

The following methods are available beginning with NUnit 2.5

CollectionAssert.IsOrdered( IEnumerable collection );

CollectionAssert.IsOrdered( IEnumerable collection, string message );

CollectionAssert.IsOrdered( IEnumerable collection, string message,

params object[] args );


CollectionAssert.IsOrdered( IEnumerable collection, IComparer comparer );

CollectionAssert.IsOrdered( IEnumerable collection, IComparer comparer,

string message );

CollectionAssert.IsOrdered( IEnumerable collection, IComparer comparer,

string message, params object[] args );

FileAssert (NUnit 2.4)

FileAssert.AreEqual( Stream expected, Stream actual );


FileAssert.AreEqual( Stream expected, Stream actual,
string message );
FileAssert.AreEqual( Stream expected, Stream actual,
string message, params object[] args );

FileAssert.AreEqual( FileInfo expected, FileInfo actual );


FileAssert.AreEqual( FileInfo expected, FileInfo actual,
string message );
FileAssert.AreEqual( FileInfo expected, FileInfo actual,
string message, params object[] args );

FileAssert.AreEqual( string expected, string actual );


FileAssert.AreEqual( string expected, string actual,
string message );
FileAssert.AreEqual( string expected, string actual,
string message, params object[] args );

FileAssert.AreNotEqual( Stream expected, Stream actual );


FileAssert.AreNotEqual( Stream expected, Stream actual,
string message );
FileAssert.AreNotEqual( Stream expected, Stream actual,
string message, params object[] args );

FileAssert.AreNotEqual( FileInfo expected, FileInfo actual );


FileAssert.AreNotEqual( FileInfo expected, FileInfo actual,
string message );
FileAssert.AreNotEqual( FileInfo expected, FileInfo actual,
string message, params object[] args );

FileAssert.AreNotEqual( string expected, string actual );


FileAssert.AreNotEqual( string expected, string actual,
string message );
FileAssert.AreNotEqual( string expected, string actual,
string message, params object[] args );

You might also like