New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[API Suggestion]: DataTableCollection and DataColumnCollection ContainItemWithName #1897
Comments
What would the proposed syntax offer over using the existing dataSet.Tables.Should().Contain(e => e.TableName == expectedTableName); |
Most significantly, https://docs.microsoft.com/en-us/dotnet/api/system.data.datacolumncollection.contains?view=net-6.0 I haven't checked but I suspect that the underlying storage keeps the elements sorted and these methods use a binary search. |
So you'd like an assertion that utilizes I had a quick glimpse at |
Huh. Well, that's disappointing, but also I feel that that's its own internal implementation detail decision to make. It's breaking boundaries to say, "Well, they do that internally, so we can just do the same thing externally." The presence of a |
I also notice that dataset.Should().HaveTable(expectedTable); instead of the proposed? dataset.Tables.Should().ContainTableWithName(expectedTable)? |
That's fair. I guess it isn't going to be terribly common for people to encounter a |
I created these for parity with other collection assertions, but it wouldn't be unreasonable to argue that the likelihood of encountering the collection without its containing type is vanishingly small, and the containing type can already do equivalent assertions. |
We should not be adding an API only because it can be implemented. It's not a goal for us for |
I think that's so, yeah. |
I agree with @jnyrup here |
That settles it then. |
The
DataTableCollection
andDataColumnCollection
types in System.Data have items with logical names. An API enhancement is proposed to allow succinct expression of assertions that these collections contain items with provided names. This functionality was originally implemented within pull request #1812, but has been separated off for independent consideration in pull request #1893.Specific API surface changes proposed:
The text was updated successfully, but these errors were encountered: