Reputation
77,330
Next tag badge:
561/400 score
77/80 answers
Badges
17 180 311
Newest
 Good Answer
Impact
~1.7m people reached

Jun
29
answered what is the difference between overengineering, underengineering and rightengineering?
Jun
27
awarded  Necromancer
Jun
27
comment Avoid FileUtil that is made for tests
@DocBrown: when reading the question, I had an impression that the OP is not working at a level of a stream, but at a level of a file. If the OP can use streams directly, it would indeed be much simpler.
Jun
26
revised Should constructors for API classes ever be public, or can a factory always be used?
added 24 characters in body
Jun
26
revised Should constructors for API classes ever be public, or can a factory always be used?
added 1315 characters in body
Jun
26
answered Should constructors for API classes ever be public, or can a factory always be used?
Jun
26
answered Avoid FileUtil that is made for tests
Jun
25
revised guideline on void methods that do not throw exceptions
added 1404 characters in body
Jun
25
comment guideline on void methods that do not throw exceptions
@hrishikeshp19: well then it's a different question than the originally posted one, which should be posted separately instead of being an edit which invalidates the previous answers.
Jun
25
comment guideline on void methods that do not throw exceptions
@hrishikeshp19: you don't need a method to return a value to unit test it. You assert that the side effects of the void method correspond to the side effects you expect in a given situation. If the void method has no side effects, you can safely remove it, as well as any call to it.
Jun
25
answered guideline on void methods that do not throw exceptions
Jun
25
comment guideline on void methods that do not throw exceptions
What makes you think that the method is not unit testable? Can you edit your question to provide the part of the code which cannot be tested?
Jun
25
revised What's wrong about extending a class with prototype methods?
added 230 characters in body
Jun
25
answered What's wrong about extending a class with prototype methods?
Jun
25
answered Why can't I use an operator like plus sign to concatenate strings?
Jun
25
comment Testing a Conversion class
@Berlo: this is classically white box testing vs. black box testing. With unit tests, you have the visibility over the tested code, so you know what is delegated to .NET Framework specifically. This means that if you need to protect yourself against the regression in which someone replaces the call to Convert by a custom (and eventually wrongly implemented) method, you need only one test—the test which ensures that the delegation is in place. You can do that through Dependency Injection by replacing Convert by a mock and checking that the mock is actually called.
Jun
24
comment Unit Testing with massive lookup tables?
@user2357112: my mistake, I thought the code was doing calls to 100+ lookups, that is to 100+ lookup tables. I edited the answer. Thank you for pointing this out.
Jun
24
revised Unit Testing with massive lookup tables?
added 137 characters in body
Jun
24
comment Unit Testing with massive lookup tables?
@JacquesB: if a method uses 100+ lookups (and it probably does other things as well), there is no way you can write unit tests for it. Integration, system and functional tests—maybe (which in turn will reduce the risk of regressions when refactoring the monster).
Jun
24
comment Unit Testing with massive lookup tables?
@coding4fun: are you sure your code is architected correctly, and that it conforms to Single responsibility principle? Maybe your class is doing too much and should be split into several, smaller classes?