Skip to content

[API Suggestion]: Set functionality for DataRowCollections #1896

@logiclrd

Description

@logiclrd

The generic collection assertions include set functionality:

  • BeSubsetOf / NotBeSubsetOf
  • IntersectWith / NotIntersectWith

This functionality used to be available for assertions on DataRowCollection objects, before support for non-generic collection assertions was removed. This removal unintentionally eliminated assertions on System.Data collections completely, as it was implemented implicitly via the collections' IEnumerable support. System.Data precedes generics in the language, and has never been updated to use IEnumerable<T>. Recently, in #1812, the ability to do these assertions on System.Data collections was reinstated, but the set support was set off for separate implementation.

A PR has been created that adds the set support for DataRowCollection as well: #1894. It has been requested that an issue be created to discuss these API changes independent of the implementation, and that's what this is.

public static class DataRowCollectionAssertionExtensions
{
    public static AndConstraint<GenericCollectionAssertions<DataRow>> BeSubsetOf(this GenericCollectionAssertions<DataRow> assertion, IEnumerable<DataRow> expectedSuperset, string because = "", params object[] becauseArgs) { }
    public static AndConstraint<GenericCollectionAssertions<DataRow>> BeSubsetOf(this GenericCollectionAssertions<DataRow> assertion, DataRowCollection expectedSuperset, string because = "", params object[] becauseArgs) { }
    public static AndConstraint<GenericCollectionAssertions<DataRow>> BeSubsetOf(this GenericCollectionAssertions<DataRow> assertion, IEnumerable<DataRow> expectedSuperset, Func<EquivalencyAssertionOptions<DataRow>, EquivalencyAssertionOptions<DataRow>> config, string because = "", params object[] becauseArgs) { }
    public static AndConstraint<GenericCollectionAssertions<DataRow>> IntersectWith(this GenericCollectionAssertions<DataRow> assertion, IEnumerable<DataRow> otherRows, string because = "", params object[] becauseArgs) { }
    public static AndConstraint<GenericCollectionAssertions<DataRow>> IntersectWith(this GenericCollectionAssertions<DataRow> assertion, DataRowCollection otherCollection, string because = "", params object[] becauseArgs) { }
    public static AndConstraint<GenericCollectionAssertions<DataRow>> IntersectWith(this GenericCollectionAssertions<DataRow> assertion, IEnumerable<DataRow> otherRows, Func<EquivalencyAssertionOptions<DataRow>, EquivalencyAssertionOptions<DataRow>> config, string because = "", params object[] becauseArgs) { }
    public static AndConstraint<GenericCollectionAssertions<DataRow>> NotBeSubsetOf(this GenericCollectionAssertions<DataRow> assertion, IEnumerable<DataRow> unexpectedSuperset, string because = "", params object[] becauseArgs) { }
    public static AndConstraint<GenericCollectionAssertions<DataRow>> NotBeSubsetOf(this GenericCollectionAssertions<DataRow> assertion, DataRowCollection unexpectedSuperset, string because = "", params object[] becauseArgs) { }
    public static AndConstraint<GenericCollectionAssertions<DataRow>> NotBeSubsetOf(this GenericCollectionAssertions<DataRow> assertion, IEnumerable<DataRow> unexpectedSuperset, Func<EquivalencyAssertionOptions<DataRow>, EquivalencyAssertionOptions<DataRow>> config, string because = "", params object[] becauseArgs) { }
    public static AndConstraint<GenericCollectionAssertions<DataRow>> NotIntersectWith(this GenericCollectionAssertions<DataRow> assertion, IEnumerable<DataRow> otherRows, string because = "", params object[] becauseArgs) { }
    public static AndConstraint<GenericCollectionAssertions<DataRow>> NotIntersectWith(this GenericCollectionAssertions<DataRow> assertion, DataRowCollection otherCollection, string because = "", params object[] becauseArgs) { }
    public static AndConstraint<GenericCollectionAssertions<DataRow>> NotIntersectWith(this GenericCollectionAssertions<DataRow> assertion, IEnumerable<DataRow> otherRows, Func<EquivalencyAssertionOptions<DataRow>, EquivalencyAssertionOptions<DataRow>> config, string because = "", params object[] becauseArgs) { }
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    api-suggestionEarly API idea and discussion, it is NOT ready for implementation

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions