-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Refactor tests #3705
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
Refactor tests #3705
Conversation
martincostello
commented
Dec 3, 2025
- Rename classes from fix(SchemaGenerator): exclude inherited properties only when base add… #3692 for clarity.
- Some style refactoring.
- Rename classes from #3692 for clarity. - Some style refactoring.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR refactors test code for clarity by renaming classes and properties from the cryptic AbcTests_A/B/C and PropA/B/C naming scheme to more descriptive names like BaseClass, DerivedClass, MostDerivedClass and corresponding properties. Additionally, minor style improvements were applied to improve code consistency.
- Renamed test classes from
AbcTests_A/B/CtoBaseClass,DerivedClass,MostDerivedClass - Renamed properties from
PropA/B/CtoBaseProperty,DerivedProperty,MoreDerivedProperty - Applied style refactoring including formatting improvements and added documentation reference
Reviewed changes
Copilot reviewed 10 out of 10 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| test/Swashbuckle.AspNetCore.SwaggerGen.Test/snapshots/VerifyTests.GenerateSchema_PreservesMultiLevelInheritance.DotNet9_0.verified.txt | Updated snapshot to reflect renamed classes and properties |
| test/Swashbuckle.AspNetCore.SwaggerGen.Test/snapshots/VerifyTests.GenerateSchema_PreservesMultiLevelInheritance.DotNet8_0.verified.txt | Updated snapshot to reflect renamed classes and properties |
| test/Swashbuckle.AspNetCore.SwaggerGen.Test/snapshots/VerifyTests.GenerateSchema_PreservesMultiLevelInheritance.DotNet10_0.verified.txt | Updated snapshot to reflect renamed classes and properties |
| test/Swashbuckle.AspNetCore.SwaggerGen.Test/snapshots/VerifyTests.GenerateSchema_PreservesIntermediateBaseProperties_WhenUsingOneOfPolymorphism.DotNet9_0.verified.txt | Updated snapshot to reflect renamed classes and properties |
| test/Swashbuckle.AspNetCore.SwaggerGen.Test/snapshots/VerifyTests.GenerateSchema_PreservesIntermediateBaseProperties_WhenUsingOneOfPolymorphism.DotNet8_0.verified.txt | Updated snapshot to reflect renamed classes and properties |
| test/Swashbuckle.AspNetCore.SwaggerGen.Test/snapshots/VerifyTests.GenerateSchema_PreservesIntermediateBaseProperties_WhenUsingOneOfPolymorphism.DotNet10_0.verified.txt | Updated snapshot to reflect renamed classes and properties |
| test/Swashbuckle.AspNetCore.SwaggerGen.Test/VerifyTests.cs | Updated test methods to use renamed classes and applied formatting improvements to collection expressions |
| test/Swashbuckle.AspNetCore.SwaggerGen.Test/SchemaGenerator/JsonSerializerSchemaGeneratorTests.cs | Updated test classes from AbcTests_A/B/C to ModelOfA/B/C with more descriptive property names |
| test/Swashbuckle.AspNetCore.SwaggerGen.Test/Fixtures/FakeControllerWithInheritance.cs | Renamed nested test classes and properties, added pragma directive, base class inheritance, and null assertion |
| src/Swashbuckle.AspNetCore.SwaggerGen/SchemaGenerator/SchemaGenerator.cs | Improved code formatting and added documentation reference comment |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| type == typeof(FakeControllerWithInheritance.BaseClass) ? [typeof(FakeControllerWithInheritance.DerivedClass), typeof(FakeControllerWithInheritance.MostDerivedClass)] | ||
| : type == typeof(FakeControllerWithInheritance.DerivedClass) ? [typeof(FakeControllerWithInheritance.MostDerivedClass)] |
Copilot
AI
Dec 3, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[nitpick] This line exceeds a reasonable line length (approximately 170 characters). Consider breaking this into multiple lines for better readability, similar to the formatting used in the previous test method (lines 1172-1175).
| type == typeof(FakeControllerWithInheritance.BaseClass) ? [typeof(FakeControllerWithInheritance.DerivedClass), typeof(FakeControllerWithInheritance.MostDerivedClass)] | |
| : type == typeof(FakeControllerWithInheritance.DerivedClass) ? [typeof(FakeControllerWithInheritance.MostDerivedClass)] | |
| type == typeof(FakeControllerWithInheritance.BaseClass) | |
| ? [typeof(FakeControllerWithInheritance.DerivedClass), typeof(FakeControllerWithInheritance.MostDerivedClass)] | |
| : type == typeof(FakeControllerWithInheritance.DerivedClass) | |
| ? [typeof(FakeControllerWithInheritance.MostDerivedClass)] |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #3705 +/- ##
==========================================
- Coverage 94.66% 94.66% -0.01%
==========================================
Files 111 111
Lines 3859 3858 -1
Branches 778 778
==========================================
- Hits 3653 3652 -1
Misses 206 206
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|