question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[API Suggestion]: Set functionality for DataRowCollections

See original GitHub issue

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) { }
}

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:15 (15 by maintainers)

github_iconTop GitHub Comments

1reaction
logiclrdcommented, Aug 8, 2022

I guess that’s the answer? Just make my own copy of the basic ObjectInfo implementation.

0reactions
logiclrdcommented, Aug 8, 2022

Oh, problem though – IObjectInfo implementations are internal. Not exactly sure how to use it either, but them being internal is the bigger problem. Or do I just have to make my own implementation??

Read more comments on GitHub >

github_iconTop Results From Across the Web

DataRowCollection Class (System.Data)
Represents a collection of rows for a DataTable. ... The second example adds a new row created by using the NewRow method to...
Read more >
Update a row using DataTable() - javascript
I would like to know the correct way to update/redraw a table row using the new API. Old questions suggest table.fnUpdate . Should...
Read more >
Mapping DataTables and DataRows to Objects in C# and . ...
Let's take data from DataTable, DataRow, and DataSet objects and use Reflection in .NET to map them automatically to full classes.
Read more >
API
API. Editor makes it quick and easy to create an editable table through the built in Buttons support and simple initialisation. But to...
Read more >
DataTable class - material library - Dart API
This sample shows how to display a DataTable with three columns: name, age, and role. The columns are defined by three DataColumn objects....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found