winforms
winforms copied to clipboard
Tests should use TheoryData<>
Theory tests should preferably use the TheoryData<>
pattern where possible. We have several hundred hits for the analyzer for this currently (xUnit1042
). The analyzer is disabled in the .editorconfig
file and can be commented out to hunt these down.
Once addressed we can turn this back on.
Could you provide example or right and wrong?Sent from my iPhoneI apologize for any typos Siri might have made.(503) 803-6077On Mar 12, 2024, at 9:48 AM, Jeremy Kuhne @.***> wrote: Theory tests should preferably use the TheoryData<> pattern where possible. We have several hundred hits for the analyzer for this currently (xUnit1042). The analyzer is disabled in the .editorconfig file and can be commented out to hunt these down. Once addressed we can turn this back on.
—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you are subscribed to this thread.Message ID: @.***>
@paul1956 this had a good example in it: https://hamidmosalla.com/2020/04/05/xunit-part-8-using-theorydata-instead-of-memberdata-and-classdata/
I was wondering if I could work on this issue.
@woefulpines yes please. There will be a lot of refactoring involved. So lots to do. Keep the PRs smaller for quicker reviews.
I have not seen anything (examples) for using TheoryData to replace InlineData, is it possible? Sent from my iPhoneI apologize for any typos Siri might have made.(503) 803-6077On Mar 15, 2024, at 9:42 PM, Lachlan Ennis @.***> wrote: @woefulpines yes please. There will be a lot of refactoring involved. So lots to do. Keep the PRs smaller for quicker reviews.
—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you were mentioned.Message ID: @.***>
Sorry for the delay. I was a little confused with how this was going to be done in small PRs. I was able to get a theory working with data and it was passing XUnit1042 in .editorconfig. Other projects and parts fail, I was thinking of keeping the editor config changes local until given the green light. I can work ahead but I just wanted to see how best to proceed.
Yes, the .editorconfig
changes will be merged separately once all occurrences have been fixed.
I had some issues for one of the test cases I was converting. I was using TheoryData, but I end up with an error: cs0050.
It seems that returning a TheoryData<...> causes an issue since the accessibility is different from the function I am returning from. I was wondering if you had seen something like this before. I couldn't find anything from my googling and the other theory data conversions don't suffer from this issue.
It seems that returning a TheoryData<...> causes an issue since the accessibility is different from the function I am returning from. I was wondering if you had seen something like this before. I was couldn't find anything from my googling and the other theory data conversions don't suffer from this issue.
In such cases, you generally have no other option but to suppress one or the other analyzer. Pick one of the lesser evils.