winforms icon indicating copy to clipboard operation
winforms copied to clipboard

Tests should use theory data

Open woefulpines opened this issue 10 months ago • 4 comments

Makes progress to fix #11041

Proposed changes

  • Changed untyped test data to use typed TheoryData objects.
  • Allowing us to enable xUnit1024 errors in .editorconfig.
  • Currently fixes test cases in Windows form analyzer (CSharp) with one exception for the file reader font converter.

Customer Impact

  • No customer impact, just refactoring old test cases.

Regression?

  • No

Risk

-There should be no risk in moving to strongly typed parameterized test methods.

Test methodology

  • Because the tests are functionally identical, I used the tests that were already present.

Test environment(s)

Microsoft Reviewers: Open in CodeFlow

woefulpines avatar Apr 06 '24 17:04 woefulpines

@dotnet-policy-service agree

woefulpines avatar Apr 06 '24 17:04 woefulpines

For the testing environments, would you like me to paste my dotnet --info or could I remove it?

woefulpines avatar Apr 06 '24 17:04 woefulpines

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 73.44649%. Comparing base (d9e9d93) to head (9bed97d). Report is 160 commits behind head on main.

Additional details and impacted files
@@                 Coverage Diff                 @@
##                main      #11171         +/-   ##
===================================================
- Coverage   73.44664%   73.44649%   -0.00016%     
===================================================
  Files           3098        3098                 
  Lines         632225      632229          +4     
  Branches       46653       46653                 
===================================================
+ Hits          464348      464350          +2     
- Misses        164485      164487          +2     
  Partials        3392        3392                 
Flag Coverage Δ
Debug 73.44649% <100.00000%> (-0.00016%) :arrow_down:
integration 18.36830% <ø> (+0.00637%) :arrow_up:
production 46.91082% <ø> (-0.00071%) :arrow_down:
test 94.98604% <100.00000%> (+0.00005%) :arrow_up:
unit 43.87654% <ø> (-0.00107%) :arrow_down:

Flags with carried forward coverage won't be shown. Click here to find out more.

codecov[bot] avatar Apr 06 '24 18:04 codecov[bot]

@woefulpines could you update PR with feedback addressed so we can take this to completion? Let me know if there are any concerns :)

lonitra avatar Apr 25 '24 15:04 lonitra

Thank you @woefulpines for starting on this work! https://github.com/dotnet/winforms/pull/11441 has built off of your PR and addressed changes, so I will be closing this one. Please feel free to continue contributing to this effort in a new PR.

lonitra avatar May 30 '24 17:05 lonitra