

[DebuggerNonUserCode()] public class GenericCollectionAssertions<TCollection,T,TAssertions> : FluentAssertions.Primitives.ReferenceTypeAssertions<TCollection,TAssertions> where TCollection: IEnumerable<T> where TAssertions: GenericCollectionAssertions<TCollection,T,TAssertions>
System.Object
FluentAssertions.Primitives.ReferenceTypeAssertions<TSubject,TAssertions>
FluentAssertions.Collections.GenericCollectionAssertions<TCollection,T,TAssertions>
FluentAssertions.Collections.GenericCollectionAssertions<T>
FluentAssertions.Collections.GenericCollectionAssertions<TCollection,T>
FluentAssertions.Collections.GenericDictionaryAssertions<TCollection,TKey,TValue,TAssertions>
FluentAssertions.Collections.StringCollectionAssertions<TCollection,TAssertions>
| Name | Description | |
|---|---|---|
![]() | CurrentAssertionChain | Provides access to the FluentAssertions.Execution.AssertionChain that this assertion class was initialized with. (Inherited from FluentAssertions.Primitives.ReferenceTypeAssertions<TCollection,TAssertions>) |
![]() | Subject | Gets the object whose value is being asserted. (Inherited from FluentAssertions.Primitives.ReferenceTypeAssertions<TCollection,TAssertions>) |
| Name | Description | |
|---|---|---|
![]() | Identifier | Overridden. Returns the type of the subject the assertion applies on. It should be a user-friendly name as it is included in the failure message. Returns the type of the subject the assertion applies on. |
| Name | Description | |
|---|---|---|
![]() | AllBeAssignableTo | Overloaded. Asserts that all items in the collection are of the specified type TExpectation |
![]() | AllBeEquivalentTo | Overloaded. Asserts that all elements in a collection of objects are equivalent to a given object. |
![]() | AllBeOfType | Overloaded. Asserts that all items in the collection are of the exact specified type TExpectation |
![]() | AllSatisfy | Asserts that a collection contains only items which meet the criteria provided by the inspector. |
![]() | BeAssignableTo | Overloaded. Asserts that the object is assignable to a variable of type T. (Inherited from FluentAssertions.Primitives.ReferenceTypeAssertions<TCollection,TAssertions>) |
![]() | BeEmpty | Asserts that the collection does not contain any items. |
![]() | BeEquivalentTo | Overloaded. Asserts that a collection of objects is equivalent to another collection of objects. |
![]() | BeInAscendingOrder | Overloaded. Asserts that a collection is ordered in ascending order according to the value of the specified propertyExpression. |
![]() | BeInDescendingOrder | Overloaded. Asserts that a collection is ordered in descending order according to the value of the specified propertyExpression. |
![]() | BeNull | Asserts that the current object has not been initialized yet. (Inherited from FluentAssertions.Primitives.ReferenceTypeAssertions<TCollection,TAssertions>) |
![]() | BeNullOrEmpty | Asserts that the collection is null or does not contain any items. |
![]() | BeOfType | Overloaded. Asserts that the object is of the specified type T. (Inherited from FluentAssertions.Primitives.ReferenceTypeAssertions<TCollection,TAssertions>) |
![]() | BeSameAs | Asserts that an object reference refers to the exact same object as another object reference. (Inherited from FluentAssertions.Primitives.ReferenceTypeAssertions<TCollection,TAssertions>) |
![]() | BeSubsetOf | Asserts that the collection is a subset of the expectedSuperset. |
![]() | Contain | Overloaded. Asserts that the collection contains the specified item. |
![]() | ContainEquivalentOf | Overloaded. Asserts that at least one element in the collection is equivalent to expectation. |
![]() | ContainInConsecutiveOrder | Overloaded. Expects the current collection to contain the specified elements in the exact same order, and to be consecutive. using their System.Object.Equals(System.Object) implementation. |
![]() | ContainInOrder | Overloaded. Expects the current collection to contain the specified elements in the exact same order, not necessarily consecutive. using their System.Object.Equals(System.Object) implementation. |
![]() | ContainItemsAssignableTo<TExpectation> | Asserts that the current collection contains at least one element that is assignable to the type TExpectation. |
![]() | ContainSingle | Overloaded. Expects the current collection to contain only a single item. |
![]() | EndWith | Overloaded. Asserts that the current collection ends with same elements in the same order as the collection identified by expectation. Elements are compared using their System.Object.Equals(System.Object). |
![]() | Equal | Overloaded. Expects the current collection to contain all the same elements in the same order as the collection identified by elements. Elements are compared using their System.Object.Equals(System.Object) method. |
![]() | Equals | Overridden. |
![]() | HaveCount | Overloaded. Asserts that the number of items in the collection matches the supplied expected amount. |
![]() | HaveCountGreaterThan | Asserts that the number of items in the collection is greater than the supplied expected amount. |
![]() | HaveCountGreaterThanOrEqualTo | Asserts that the number of items in the collection is greater than or equal to the supplied expected amount. |
![]() | HaveCountLessThan | Asserts that the number of items in the collection is less than the supplied expected amount. |
![]() | HaveCountLessThanOrEqualTo | Asserts that the number of items in the collection is less than or equal to the supplied expected amount. |
![]() | HaveElementAt | Asserts that the current collection has the supplied element at the supplied index. |
![]() | HaveElementPreceding | Asserts that the expectation element directly precedes the successor. |
![]() | HaveElementSucceeding | Asserts that the expectation element directly succeeds the predecessor. |
![]() | HaveSameCount<TExpectation> | Assert that the current collection has the same number of elements as otherCollection. |
![]() | IntersectWith | Asserts that the collection shares one or more items with the specified otherCollection. |
![]() | Match | Overloaded. Asserts that the predicate is satisfied. (Inherited from FluentAssertions.Primitives.ReferenceTypeAssertions<TCollection,TAssertions>) |
![]() | NotBeAssignableTo | Overloaded. Asserts that the object is not assignable to a variable of type T. (Inherited from FluentAssertions.Primitives.ReferenceTypeAssertions<TCollection,TAssertions>) |
![]() | NotBeEmpty | Asserts that the collection contains at least 1 item. |
![]() | NotBeEquivalentTo | Overloaded. Expects the current collection not to contain all elements of the collection identified by unexpected, regardless of the order. Elements are compared using their System.Object.Equals(System.Object). |
![]() | NotBeInAscendingOrder | Overloaded. Asserts that a collection is not ordered in ascending order according to the value of the specified propertyExpression. |
![]() | NotBeInDescendingOrder | Overloaded. Asserts that a collection is not ordered in descending order according to the value of the specified propertyExpression. |
![]() | NotBeNull | Asserts that the current object has been initialized. (Inherited from FluentAssertions.Primitives.ReferenceTypeAssertions<TCollection,TAssertions>) |
![]() | NotBeNullOrEmpty | Asserts that the collection is not null and contains at least 1 item. |
![]() | NotBeOfType | Overloaded. Asserts that the object is not of the specified type T. (Inherited from FluentAssertions.Primitives.ReferenceTypeAssertions<TCollection,TAssertions>) |
![]() | NotBeSameAs | Asserts that an object reference refers to a different object than another object reference refers to. (Inherited from FluentAssertions.Primitives.ReferenceTypeAssertions<TCollection,TAssertions>) |
![]() | NotBeSubsetOf | Asserts that the collection is not a subset of the unexpectedSuperset. |
![]() | NotContain | Overloaded. Asserts that the current collection does not contain the supplied unexpected item. |
![]() | NotContainEquivalentOf | Overloaded. Asserts that no element in the collection is equivalent to unexpected. |
![]() | NotContainInConsecutiveOrder | Overloaded. Asserts the current collection does not contain the specified elements in the exact same order and are consecutive. |
![]() | NotContainInOrder | Overloaded. Asserts the current collection does not contain the specified elements in the exact same order, not necessarily consecutive. |
![]() | NotContainItemsAssignableTo | Overloaded. Asserts that the current collection does not contain any elements that are assignable to the type TExpectation. |
![]() | NotContainNulls | Overloaded. Asserts that the collection does not contain any a null reference (Nothing in Visual Basic) items. |
![]() | NotEqual | Expects the current collection not to contain all the same elements in the same order as the collection identified by unexpected. Elements are compared using their System.Object.Equals(System.Object). |
![]() | NotHaveCount | Asserts that the number of items in the collection does not match the supplied unexpected amount. |
![]() | NotHaveSameCount<TExpectation> | Assert that the current collection does not have the same number of elements as otherCollection. |
![]() | NotIntersectWith | Asserts that the collection does not share any items with the specified otherCollection. |
![]() | OnlyContain | Asserts that the collection only contains items that match a predicate. |
![]() | OnlyHaveUniqueItems | Overloaded. Asserts that the collection does not contain any duplicate items. |
![]() | Satisfy | Overloaded. Asserts that a collection contains exactly a given number of elements which meet the criteria provided by the element predicates. Assertion fails if it is not possible to find a one-to-one mapping between the elements of the collection and the predicates. The order of the predicates does not need to match the order of the elements. |
![]() | SatisfyRespectively | Overloaded. Asserts that a collection contains exactly a given number of elements, which meet the criteria provided by the element inspectors. |
![]() | StartWith | Overloaded. Asserts that the current collection starts with same elements in the same order as the collection identified by expectation. Elements are compared using their System.Object.Equals(System.Object). |
| Name | Description | |
|---|---|---|
![]() | As<TTo> | Safely casts the specified object to the type specified through TTo. |
![]() | Awaiting | Overloaded. Invokes the specified action on a subject so that you can chain it with any of the assertions from FluentAssertions.Specialized.NonGenericAsyncFunctionAssertions |
![]() | Enumerating | Overloaded. Forces enumerating a collection. Should be used to assert that a method that uses the yield keyword throws a particular exception. |
![]() | ExecutionTimeOf<T> | Provides methods for asserting the execution time of a method or property. |
![]() | Invoking | Overloaded. Invokes the specified action on a subject so that you can chain it with any of the assertions from FluentAssertions.Specialized.ActionAssertions |
![]() | Monitor | Overloaded. Starts monitoring eventSource for its events. |
![]() | Should | Overloaded. Returns an FluentAssertions.Specialized.ExecutionTimeAssertions object that can be used to assert the current FluentAssertions.Specialized.ExecutionTime. |
![]() | Should | Overloaded. Returns an FluentAssertions.Primitives.EnumAssertions<TEnum,TAssertions> object that can be used to assert the current TEnum. |
.NET: net5.0, net5.0-windows, net6.0, net6.0-macos, net6.0-windows, net7.0, net7.0-macos, net7.0-windows, net8.0, net8.0-browser, net8.0-macos, net8.0-windows, net9.0, net9.0-browser, net9.0-macos, net9.0-windows, net10.0, net10.0-browser, net10.0-macos, net10.0-windows.
.NET Standard: netstandard2.0, netstandard2.1.
.NET Framework: net40, net403, net45, net451, net452, net46, net461, net462, net463, net47, net471, net472, net48, net481.