Breaking dependencies in unit tests

"Would I use classloader magic and bytecode manipulation to set dependencies in production code? No. Would I use reflection to modify private fields in production code? No. Would I refactor to introduce an interface between objects? Yes. Would I refactor an object to get a dependency through its constructor instead of from a global variable? Yes." Nat Pryce

Comments

Popular posts from this blog

Upcoming F# struct tuples: are they always faster?

Computing cryptography hashes: Rust, F#, D and Scala

Composing custom error types in F#