Replies: 6 comments 11 replies
-
I'm very positive. For our unit tests I've also thought about the approach described in http://haacked.com/archive/2012/01/02/structuring-unit-tests.aspx/ where each method under test has it's own subclass. |
Beta Was this translation helpful? Give feedback.
-
I'm not very fond of partial files for the production code, especially because I always use Rider's Structure Window to see where a new method should go, or use it for reordering. However, I do acknowledge the problem with our test files. There it may make sense to group them in a better way or use partial classes. |
Beta Was this translation helpful? Give feedback.
-
Okay, let's try it out with test classes for now. Here are some suggestions for the structure
I would vote against simply naming them |
Beta Was this translation helpful? Give feedback.
-
Funny, I see |
Beta Was this translation helpful? Give feedback.
-
So did we settle on option 1 @jnyrup @eNeRGy164 ? |
Beta Was this translation helpful? Give feedback.
-
Then we also need to think of a way to improve the equivalency specs where all of them use the same method, |
Beta Was this translation helpful? Give feedback.
-
Just a suggestion.
As I am currently working in
TypeAssertions.cs
(1500+ lines) andTypeAssertionSpecs.cs
(5500+ lines) these files are huge.Would it be an idea to split these files in separate files for maintainability?
Making the static class
partial
should not change the public signature.I do this for my projects that contain large amounts of extension methods, f.e. PlantUml.Builder/StringBuilderExtensions, PlantUml.Builder.Tests/StringBuilderExtensions.
Depending on the file structure I have a dedicated folder per class, or I name my files like
StringBuilderExtensions.SkinParameter.cs
containing all the.SkinParameter(...)
methods and overloads.Some of the benefits:
TypeAssertions.cs
does not reflect which of the 55! methods is modified, a change inTypeAssertions.HaveProperty.cs
does give it away)Beta Was this translation helpful? Give feedback.
All reactions