Skip to content
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

DataSet Collections: ContainItemWithName #1893

Conversation

logiclrd
Copy link
Contributor

This PR adds functionality on top of the DataSet assertions which was originally written for #1812 but which got moved out for its own independent pull request/evaluation. The changes apply to DataTableCollection and DataColumnCollection, which have elements that are logically named, and include unit tests and documentation.

IMPORTANT

  • The code complies with the Coding Guidelines for C#.
  • The changes are covered by unit tests which follow the Arrange-Act-Assert syntax and the naming conventions such as is used in these tests.
  • If the PR adds a feature or fixes a bug, please update the release notes with a functional description that explains what the change means to consumers of this library, which are published on the website.
  • If the PR changes the public API the changes needs to be included by running AcceptApiChanges.ps1 or AcceptApiChanges.sh.
  • If the PR affects the documentation, please include your changes in this pull request so the documentation will appear on the website.

…rtionExtensions.cs and DataColumnCollectionAssertionExtensions.cs and corresponding tests in DataTableCollectionAssertionExtensionsSpecs.cs and DataColumnCollectionAssertionExtensionsSpecs.cs.

Reran AcceptApiChanges.ps1.
Updated releases.md to describe this change.
Updated data.md to describe this functionality.
@jnyrup
Copy link
Member

jnyrup commented Apr 16, 2022

Also please move the API discussion to an issue.
Note how I edited #1896 with the proposed API.

@logiclrd logiclrd changed the title DataSet Collections: ContainsByName DataSet Collections: Contain___WithName Apr 16, 2022
@logiclrd logiclrd changed the title DataSet Collections: Contain___WithName DataSet Collections: ContainItemWithName Apr 16, 2022
@logiclrd
Copy link
Contributor Author

API proposal discussion issue: #1897

@dennisdoomen
Copy link
Member

As discussed in #1897, we decided not to make this API part of the library.

@logiclrd
Copy link
Contributor Author

logiclrd commented Aug 6, 2022

If I wanted to make my own extension library and make this a part of it, I would run into the problem that the code needs to identify the type ReadOnlyNonGenericCollectionWrapper<TCollection, TItem>, and that type is internal. What is the recommendation for this situation?

  • Reflection? Slow and not type-safe.
  • Make the type public? Leaky.
  • [InternalsVisibleTo] in the main library?
  • Other?

Thanks :-)

@dennisdoomen
Copy link
Member

I can't think of any other way then just making that wrapper public. You can submit a PR for that if you want

@logiclrd
Copy link
Contributor Author

logiclrd commented Aug 7, 2022

Alright, will do. Thanks :-)

@logiclrd
Copy link
Contributor Author

logiclrd commented Aug 7, 2022

Oh, huh, the wrapper doesn't exist any more in the mainline. The code in this branch isn't compatible with 6.0 now that non-generic collection support got removed.

@logiclrd
Copy link
Contributor Author

logiclrd commented Aug 7, 2022

So, I never added unit tests explicitly asserting that basic collection functionality worked on DataTableCollection, DataColumnCollection and DataRowCollection. It "just worked" because these types implement IEnumerable. The lack of tests meant that when non-generic collection support was removed, it must have introduced an undetected regression in this area. I should have explicitly tested those types. Sigh. :-P

I was pulling from the wrong upstream. 🤦‍♂️

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants