Support runtimes where ReflectedType exists such as NetStandard2.0 compatible runtimes #2419
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This relates to issue #1983
The calling code that fails is this particular call in DataDiscoverer:
xunit/src/xunit.core/Sdk/DataDiscoverer.cs
Line 32 in 4db2e39
This change should restore the functionality that worked on NetStandard 2.0 compatible runtimes with v2.4.0 that breaks when upgrading to 2.4.1 (where NetStandard2.0 target was removed breaking this particular call.
I think the missing unit tests are possible but still working out where they go into this file. Potentially alongside this test case?
xunit/test/test.xunit.execution/Acceptance/Xunit2TheoryAcceptanceTests.cs
Lines 869 to 888 in 4db2e39
EDIT: After some playing around I've realised none of these theory tests light up for non .Net Full Framework anyway.
I've tried to do this as low impact as possible.
I investigated just using DeclaringType but there is a subtle difference, which is exactly what the DataDiscoverer is using it for.
(DeclaringType would resolve to the base class while ReflectedType will correctly use the derived test class type, according to Stack Overflow)
Thanks in Advance. All feedback appreciated