All Questions
4 questions
-2
votes
2
answers
3k
views
Best practices around writing testable extension methods
I’m currently working in C# and I’d like to write and extension method against a type. There is a small amount of repeated logic between classes surrounding JSON deserialization, using the ...
1
vote
1
answer
277
views
NUnit specify TestCaseAttribute on implementation or create a test method
Based on this question about the correct usage of nUnit's TestCaseAttribute, I was wondering whether to specify the test case directly on the implementation or create test methods (as when using ...
3
votes
3
answers
636
views
Is it considered a bad coding practice to write methods/properties that support (only) testing? [duplicate]
When I write (unit) tests I always try to avoid for example microsoft fakes because then the edit&continue feature no longer works. However this often requires refactoring... and sometimes methods ...
88
votes
11
answers
19k
views
Is it a bad practice to modify code strictly for testing purposes
I have a debate with a programmer colleague about whether it is a good or bad practice to modify a working piece of code only to make it testable (via unit tests for example).
My opinion is that it ...