IGLib
1.7.2
The IGLib base library EXTENDED - with other lilbraries and applications.
|
A set of Assert methods operating on one or more collections More...
Static Public Member Functions | |
static new bool | Equals (object a, object b) |
The Equals method throws an AssertionException. This is done to make sure there is no mistake by calling this function. More... | |
static new void | ReferenceEquals (object a, object b) |
override the default ReferenceEquals to throw an AssertionException. This implementation makes sure there is no mistake in calling this function as part of Assert. More... | |
static void | AllItemsAreInstancesOfType (IEnumerable collection, Type expectedType) |
Asserts that all items contained in collection are of the type specified by expectedType. More... | |
static void | AllItemsAreInstancesOfType (IEnumerable collection, Type expectedType, string message, params object[] args) |
Asserts that all items contained in collection are of the type specified by expectedType. More... | |
static void | AllItemsAreNotNull (IEnumerable collection) |
Asserts that all items contained in collection are not equal to null. More... | |
static void | AllItemsAreNotNull (IEnumerable collection, string message, params object[] args) |
Asserts that all items contained in collection are not equal to null. More... | |
static void | AllItemsAreUnique (IEnumerable collection) |
Ensures that every object contained in collection exists within the collection once and only once. More... | |
static void | AllItemsAreUnique (IEnumerable collection, string message, params object[] args) |
Ensures that every object contained in collection exists within the collection once and only once. More... | |
static void | AreEqual (IEnumerable expected, IEnumerable actual) |
Asserts that expected and actual are exactly equal. The collections must have the same count, and contain the exact same objects in the same order. More... | |
static void | AreEqual (IEnumerable expected, IEnumerable actual, IComparer comparer) |
Asserts that expected and actual are exactly equal. The collections must have the same count, and contain the exact same objects in the same order. If comparer is not null then it will be used to compare the objects. More... | |
static void | AreEqual (IEnumerable expected, IEnumerable actual, string message, params object[] args) |
Asserts that expected and actual are exactly equal. The collections must have the same count, and contain the exact same objects in the same order. More... | |
static void | AreEqual (IEnumerable expected, IEnumerable actual, IComparer comparer, string message, params object[] args) |
Asserts that expected and actual are exactly equal. The collections must have the same count, and contain the exact same objects in the same order. If comparer is not null then it will be used to compare the objects. More... | |
static void | AreEquivalent (IEnumerable expected, IEnumerable actual) |
Asserts that expected and actual are equivalent, containing the same objects but the match may be in any order. More... | |
static void | AreEquivalent (IEnumerable expected, IEnumerable actual, string message, params object[] args) |
Asserts that expected and actual are equivalent, containing the same objects but the match may be in any order. More... | |
static void | AreNotEqual (IEnumerable expected, IEnumerable actual) |
Asserts that expected and actual are not exactly equal. More... | |
static void | AreNotEqual (IEnumerable expected, IEnumerable actual, IComparer comparer) |
Asserts that expected and actual are not exactly equal. If comparer is not null then it will be used to compare the objects. More... | |
static void | AreNotEqual (IEnumerable expected, IEnumerable actual, string message, params object[] args) |
Asserts that expected and actual are not exactly equal. More... | |
static void | AreNotEqual (IEnumerable expected, IEnumerable actual, IComparer comparer, string message, params object[] args) |
Asserts that expected and actual are not exactly equal. If comparer is not null then it will be used to compare the objects. More... | |
static void | AreNotEquivalent (IEnumerable expected, IEnumerable actual) |
Asserts that expected and actual are not equivalent. More... | |
static void | AreNotEquivalent (IEnumerable expected, IEnumerable actual, string message, params object[] args) |
Asserts that expected and actual are not equivalent. More... | |
static void | Contains (IEnumerable collection, Object actual) |
Asserts that collection contains actual as an item. More... | |
static void | Contains (IEnumerable collection, Object actual, string message, params object[] args) |
Asserts that collection contains actual as an item. More... | |
static void | DoesNotContain (IEnumerable collection, Object actual) |
Asserts that collection does not contain actual as an item. More... | |
static void | DoesNotContain (IEnumerable collection, Object actual, string message, params object[] args) |
Asserts that collection does not contain actual as an item. More... | |
static void | IsNotSubsetOf (IEnumerable subset, IEnumerable superset) |
Asserts that the superset does not contain the subset More... | |
static void | IsNotSubsetOf (IEnumerable subset, IEnumerable superset, string message, params object[] args) |
Asserts that the superset does not contain the subset More... | |
static void | IsSubsetOf (IEnumerable subset, IEnumerable superset) |
Asserts that the superset contains the subset. More... | |
static void | IsSubsetOf (IEnumerable subset, IEnumerable superset, string message, params object[] args) |
Asserts that the superset contains the subset. More... | |
static void | IsNotSupersetOf (IEnumerable superset, IEnumerable subset) |
Asserts that the subset does not contain the superset More... | |
static void | IsNotSupersetOf (IEnumerable superset, IEnumerable subset, string message, params object[] args) |
Asserts that the subset does not contain the superset More... | |
static void | IsSupersetOf (IEnumerable superset, IEnumerable subset) |
Asserts that the subset contains the superset. More... | |
static void | IsSupersetOf (IEnumerable superset, IEnumerable subset, string message, params object[] args) |
Asserts that the subset contains the superset. More... | |
static void | IsEmpty (IEnumerable collection, string message, params object[] args) |
Assert that an array, list or other collection is empty More... | |
static void | IsEmpty (IEnumerable collection) |
Assert that an array,list or other collection is empty More... | |
static void | IsNotEmpty (IEnumerable collection, string message, params object[] args) |
Assert that an array, list or other collection is empty More... | |
static void | IsNotEmpty (IEnumerable collection) |
Assert that an array,list or other collection is empty More... | |
static void | IsOrdered (IEnumerable collection, string message, params object[] args) |
Assert that an array, list or other collection is ordered More... | |
static void | IsOrdered (IEnumerable collection) |
Assert that an array, list or other collection is ordered More... | |
static void | IsOrdered (IEnumerable collection, IComparer comparer, string message, params object[] args) |
Assert that an array, list or other collection is ordered More... | |
static void | IsOrdered (IEnumerable collection, IComparer comparer) |
Assert that an array, list or other collection is ordered More... | |
A set of Assert methods operating on one or more collections
|
inlinestatic |
The Equals method throws an AssertionException. This is done to make sure there is no mistake by calling this function.
a | |
b |
|
inlinestatic |
override the default ReferenceEquals to throw an AssertionException. This implementation makes sure there is no mistake in calling this function as part of Assert.
a | |
b |
|
inlinestatic |
Asserts that all items contained in collection are of the type specified by expectedType.
collection | IEnumerable containing objects to be considered |
expectedType | System.Type that all objects in collection must be instances of |
Referenced by NUnit.Framework.Tests.AssertSyntaxTests.AllItemsTests(), NUnit.Framework.Assertions.CollectionAssertTest.ItemsOfType(), and NUnit.Framework.Assertions.CollectionAssertTest.ItemsOfTypeFailure().
|
inlinestatic |
Asserts that all items contained in collection are of the type specified by expectedType.
collection | IEnumerable containing objects to be considered |
expectedType | System.Type that all objects in collection must be instances of |
message | The message that will be displayed on failure |
args | Arguments to be used in formatting the message |
References NUnit.Framework.Is.All, NUnit.Framework.Constraints.ConstraintExpression.InstanceOf(), and NUnit.Framework.Assert.That().
|
inlinestatic |
Asserts that all items contained in collection are not equal to null.
collection | IEnumerable containing objects to be considered |
Referenced by NUnit.Framework.Tests.AssertSyntaxTests.AllItemsTests(), NUnit.Framework.Assertions.CollectionAssertTest.ItemsNotNull(), and NUnit.Framework.Assertions.CollectionAssertTest.ItemsNotNullFailure().
|
inlinestatic |
Asserts that all items contained in collection are not equal to null.
collection | IEnumerable of objects to be considered |
message | The message that will be displayed on failure |
args | Arguments to be used in formatting the message |
References NUnit.Framework.Is.All, NUnit.Framework.Constraints.ConstraintExpression.Not, NUnit.Framework.Constraints.ConstraintExpression.Null, and NUnit.Framework.Assert.That().
|
inlinestatic |
Ensures that every object contained in collection exists within the collection once and only once.
collection | IEnumerable of objects to be considered |
Referenced by NUnit.Framework.Tests.AssertSyntaxTests.AllItemsTests(), NUnit.Framework.Assertions.CollectionAssertTest.Unique_WithNull(), NUnit.Framework.Assertions.CollectionAssertTest.Unique_WithObjects(), NUnit.Framework.Assertions.CollectionAssertTest.Unique_WithStrings(), NUnit.Framework.Assertions.CollectionAssertTest.UniqueFailure(), and NUnit.Framework.Assertions.CollectionAssertTest.UniqueFailure_WithTwoNulls().
|
inlinestatic |
Ensures that every object contained in collection exists within the collection once and only once.
collection | IEnumerable of objects to be considered |
message | The message that will be displayed on failure |
args | Arguments to be used in formatting the message |
References NUnit.Framework.Assert.That(), and NUnit.Framework.Is.Unique.
|
inlinestatic |
Asserts that expected and actual are exactly equal. The collections must have the same count, and contain the exact same objects in the same order.
expected | The first IEnumerable of objects to be considered |
actual | The second IEnumerable of objects to be considered |
Referenced by NUnit.Framework.Assertions.CollectionAssertTest.AreEqual(), NUnit.Framework.Assertions.CollectionAssertTest.AreEqual_HandlesNull(), NUnit.Framework.Assertions.CollectionAssertTest.AreEqual_UsingIterator(), NUnit.Framework.Assertions.CollectionAssertTest.AreEqual_UsingIterator_Fails(), NUnit.Framework.Assertions.CollectionAssertTest.AreEqual_UsingLinqQuery(), NUnit.Framework.Assertions.CollectionAssertTest.AreEqual_UsingLinqQuery_Fails(), NUnit.Framework.Assertions.CollectionAssertTest.AreEqualFail(), NUnit.Framework.Assertions.CollectionAssertTest.AreEqualFailCount(), and NUnit.Framework.Assertions.CollectionAssertTest.EnsureComparerIsUsed().
|
inlinestatic |
Asserts that expected and actual are exactly equal. The collections must have the same count, and contain the exact same objects in the same order. If comparer is not null then it will be used to compare the objects.
expected | The first IEnumerable of objects to be considered |
actual | The second IEnumerable of objects to be considered |
comparer | The IComparer to use in comparing objects from each IEnumerable |
|
inlinestatic |
Asserts that expected and actual are exactly equal. The collections must have the same count, and contain the exact same objects in the same order.
expected | The first IEnumerable of objects to be considered |
actual | The second IEnumerable of objects to be considered |
message | The message that will be displayed on failure |
args | Arguments to be used in formatting the message |
References NUnit.Framework.Is.EqualTo(), and NUnit.Framework.Assert.That().
|
inlinestatic |
Asserts that expected and actual are exactly equal. The collections must have the same count, and contain the exact same objects in the same order. If comparer is not null then it will be used to compare the objects.
expected | The first IEnumerable of objects to be considered |
actual | The second IEnumerable of objects to be considered |
comparer | The IComparer to use in comparing objects from each IEnumerable |
message | The message that will be displayed on failure |
args | Arguments to be used in formatting the message |
References NUnit.Framework.Is.EqualTo(), NUnit.Framework.Assert.That(), and NUnit.Framework.Constraints.EqualConstraint.Using().
|
inlinestatic |
Asserts that expected and actual are equivalent, containing the same objects but the match may be in any order.
expected | The first IEnumerable of objects to be considered |
actual | The second IEnumerable of objects to be considered |
Referenced by NUnit.Framework.Assertions.CollectionAssertTest.AreEquivalentHandlesNull(), NUnit.Framework.Tests.AssertSyntaxTests.CollectionEquivalenceTests(), NUnit.Framework.Assertions.CollectionAssertTest.Equivalent(), NUnit.Framework.Assertions.CollectionAssertTest.EquivalentFailOne(), and NUnit.Framework.Assertions.CollectionAssertTest.EquivalentFailTwo().
|
inlinestatic |
Asserts that expected and actual are equivalent, containing the same objects but the match may be in any order.
expected | The first IEnumerable of objects to be considered |
actual | The second IEnumerable of objects to be considered |
message | The message that will be displayed on failure |
args | Arguments to be used in formatting the message |
References NUnit.Framework.Is.EquivalentTo(), and NUnit.Framework.Assert.That().
|
inlinestatic |
Asserts that expected and actual are not exactly equal.
expected | The first IEnumerable of objects to be considered |
actual | The second IEnumerable of objects to be considered |
Referenced by NUnit.Framework.Assertions.CollectionAssertTest.AreNotEqual(), NUnit.Framework.Assertions.CollectionAssertTest.AreNotEqual_Fails(), and NUnit.Framework.Assertions.CollectionAssertTest.AreNotEqual_HandlesNull().
|
inlinestatic |
Asserts that expected and actual are not exactly equal. If comparer is not null then it will be used to compare the objects.
expected | The first IEnumerable of objects to be considered |
actual | The second IEnumerable of objects to be considered |
comparer | The IComparer to use in comparing objects from each IEnumerable |
|
inlinestatic |
Asserts that expected and actual are not exactly equal.
expected | The first IEnumerable of objects to be considered |
actual | The second IEnumerable of objects to be considered |
message | The message that will be displayed on failure |
args | Arguments to be used in formatting the message |
References NUnit.Framework.Constraints.ConstraintExpression.EqualTo(), NUnit.Framework.Is.Not, and NUnit.Framework.Assert.That().
|
inlinestatic |
Asserts that expected and actual are not exactly equal. If comparer is not null then it will be used to compare the objects.
expected | The first IEnumerable of objects to be considered |
actual | The second IEnumerable of objects to be considered |
comparer | The IComparer to use in comparing objects from each IEnumerable |
message | The message that will be displayed on failure |
args | Arguments to be used in formatting the message |
References NUnit.Framework.Constraints.ConstraintExpression.EqualTo(), NUnit.Framework.Is.Not, NUnit.Framework.Assert.That(), and NUnit.Framework.Constraints.EqualConstraint.Using().
|
inlinestatic |
Asserts that expected and actual are not equivalent.
expected | The first IEnumerable of objects to be considered |
actual | The second IEnumerable of objects to be considered |
Referenced by NUnit.Framework.Tests.AssertSyntaxTests.CollectionEquivalenceTests(), NUnit.Framework.Assertions.CollectionAssertTest.NotEquivalent(), NUnit.Framework.Assertions.CollectionAssertTest.NotEquivalent_Fails(), and NUnit.Framework.Assertions.CollectionAssertTest.NotEquivalentHandlesNull().
|
inlinestatic |
Asserts that expected and actual are not equivalent.
expected | The first IEnumerable of objects to be considered |
actual | The second IEnumerable of objects to be considered |
message | The message that will be displayed on failure |
args | Arguments to be used in formatting the message |
References NUnit.Framework.Constraints.ConstraintExpression.EquivalentTo(), NUnit.Framework.Is.Not, and NUnit.Framework.Assert.That().
|
inlinestatic |
Asserts that collection contains actual as an item.
collection | IEnumerable of objects to be considered |
actual | Object to be found within collection |
Referenced by NUnit.Framework.Tests.AssertSyntaxTests.CollectionContainsTests(), NUnit.Framework.Assertions.CollectionAssertTest.Contains_ICollection(), NUnit.Framework.Assertions.CollectionAssertTest.Contains_IList(), NUnit.Framework.Assertions.CollectionAssertTest.ContainsFails_EmptyICollection(), NUnit.Framework.Assertions.CollectionAssertTest.ContainsFails_EmptyIList(), NUnit.Framework.Assertions.CollectionAssertTest.ContainsFails_ICollection(), NUnit.Framework.Assertions.CollectionAssertTest.ContainsFails_ILIst(), NUnit.Framework.Assertions.CollectionAssertTest.ContainsNull_ICollection(), and NUnit.Framework.Assertions.CollectionAssertTest.ContainsNull_IList().
|
inlinestatic |
Asserts that collection contains actual as an item.
collection | IEnumerable of objects to be considered |
actual | Object to be found within collection |
message | The message that will be displayed on failure |
args | Arguments to be used in formatting the message |
References NUnit.Framework.Has.Member(), and NUnit.Framework.Assert.That().
|
inlinestatic |
Asserts that collection does not contain actual as an item.
collection | IEnumerable of objects to be considered |
actual | Object that cannot exist within collection |
Referenced by NUnit.Framework.Tests.AssertSyntaxTests.CollectionContainsTests(), NUnit.Framework.Assertions.CollectionAssertTest.DoesNotContain(), NUnit.Framework.Assertions.CollectionAssertTest.DoesNotContain_Empty(), and NUnit.Framework.Assertions.CollectionAssertTest.DoesNotContain_Fails().
|
inlinestatic |
Asserts that collection does not contain actual as an item.
collection | IEnumerable of objects to be considered |
actual | Object that cannot exist within collection |
message | The message that will be displayed on failure |
args | Arguments to be used in formatting the message |
References NUnit.Framework.Constraints.ConstraintExpression.Member(), NUnit.Framework.Has.No, and NUnit.Framework.Assert.That().
|
inlinestatic |
Asserts that the superset does not contain the subset
subset | The IEnumerable subset to be considered |
superset | The IEnumerable superset to be considered |
Referenced by NUnit.Framework.Assertions.CollectionAssertTest.IsNotSubsetOf(), NUnit.Framework.Assertions.CollectionAssertTest.IsNotSubsetOf_Fails(), NUnit.Framework.Assertions.CollectionAssertTest.IsNotSubsetOfHandlesNull(), and NUnit.Framework.Tests.AssertSyntaxTests.SubsetTests().
|
inlinestatic |
Asserts that the superset does not contain the subset
subset | The IEnumerable subset to be considered |
superset | The IEnumerable superset to be considered |
message | The message that will be displayed on failure |
args | Arguments to be used in formatting the message |
References NUnit.Framework.Is.Not, NUnit.Framework.Constraints.ConstraintExpression.SubsetOf(), and NUnit.Framework.Assert.That().
|
inlinestatic |
Asserts that the superset contains the subset.
subset | The IEnumerable subset to be considered |
superset | The IEnumerable superset to be considered |
Referenced by NUnit.Framework.Assertions.CollectionAssertTest.IsSubsetOf(), NUnit.Framework.Assertions.CollectionAssertTest.IsSubsetOf_Fails(), NUnit.Framework.Assertions.CollectionAssertTest.IsSubsetOfHandlesNull(), and NUnit.Framework.Tests.AssertSyntaxTests.SubsetTests().
|
inlinestatic |
Asserts that the superset contains the subset.
subset | The IEnumerable subset to be considered |
superset | The IEnumerable superset to be considered |
message | The message that will be displayed on failure |
args | Arguments to be used in formatting the message |
References NUnit.Framework.Is.SubsetOf(), and NUnit.Framework.Assert.That().
|
inlinestatic |
Asserts that the subset does not contain the superset
superset | The IEnumerable superset to be considered |
subset | The IEnumerable subset to be considered |
|
inlinestatic |
Asserts that the subset does not contain the superset
superset | The IEnumerable superset to be considered |
subset | The IEnumerable subset to be considered |
message | The message that will be displayed on failure |
args | Arguments to be used in formatting the message |
References NUnit.Framework.Is.Not, NUnit.Framework.Constraints.ConstraintExpression.SupersetOf(), and NUnit.Framework.Assert.That().
|
inlinestatic |
Asserts that the subset contains the superset.
superset | The IEnumerable superset to be considered |
subset | The IEnumerable subset to be considered |
|
inlinestatic |
Asserts that the subset contains the superset.
superset | The IEnumerable superset to be considered |
subset | The IEnumerable subset to be considered |
message | The message that will be displayed on failure |
args | Arguments to be used in formatting the message |
References NUnit.Framework.Is.SupersetOf(), and NUnit.Framework.Assert.That().
|
inlinestatic |
Assert that an array, list or other collection is empty
collection | An array, list or other collection implementing IEnumerable |
message | The message to be displayed on failure |
args | Arguments to be used in formatting the message |
|
inlinestatic |
Assert that an array,list or other collection is empty
collection | An array, list or other collection implementing IEnumerable |
|
inlinestatic |
Assert that an array, list or other collection is empty
collection | An array, list or other collection implementing IEnumerable |
message | The message to be displayed on failure |
args | Arguments to be used in formatting the message |
|
inlinestatic |
Assert that an array,list or other collection is empty
collection | An array, list or other collection implementing IEnumerable |
|
inlinestatic |
Assert that an array, list or other collection is ordered
collection | An array, list or other collection implementing IEnumerable |
message | The message to be displayed on failure |
args | Arguments to be used in formatting the message |
Referenced by NUnit.Framework.Assertions.CollectionAssertTest.IsOrdered(), NUnit.Framework.Assertions.CollectionAssertTest.IsOrdered_Allows_adjacent_equal_values(), NUnit.Framework.Assertions.CollectionAssertTest.IsOrdered_ContainedTypesMustBeCompatible(), NUnit.Framework.Assertions.CollectionAssertTest.IsOrdered_Fails(), NUnit.Framework.Assertions.CollectionAssertTest.IsOrdered_Handles_custom_comparison(), NUnit.Framework.Assertions.CollectionAssertTest.IsOrdered_Handles_custom_comparison2(), NUnit.Framework.Assertions.CollectionAssertTest.IsOrdered_Handles_null(), and NUnit.Framework.Assertions.CollectionAssertTest.IsOrdered_TypesMustImplementIComparable().
|
inlinestatic |
Assert that an array, list or other collection is ordered
collection | An array, list or other collection implementing IEnumerable |
|
inlinestatic |
Assert that an array, list or other collection is ordered
collection | An array, list or other collection implementing IEnumerable |
comparer | A custom comparer to perform the comparisons |
message | The message to be displayed on failure |
args | Arguments to be used in formatting the message |
References NUnit.Framework.Is.Ordered, NUnit.Framework.Assert.That(), and NUnit.Framework.Constraints.CollectionOrderedConstraint.Using().
|
inlinestatic |
Assert that an array, list or other collection is ordered
collection | An array, list or other collection implementing IEnumerable |
comparer | A custom comparer to perform the comparisons |