>> Abstraction is great, we use interfaces all the time. But at some point, you just have to implement (and test) your RegistryStorage and FileStorage classes (two implementations of the IStorage interface). To test these, you'll *have* to touch the filesystem and the registry (which is actually a db). <<
Yes, I agree with this notion. I believe that every line of production code must be backed by a test, whether that is a unit test, an acceptance test, end-to-end test, system test, or whatever you call it.
However, there can conceivably be one class that writes to the file system. That class can be used over and over within the production code. And there should be a test around that class. But for the 50 classes that depend on that class, it can be mocked out with an in-memory version of that class.
Flat View: This topic has 50 replies
on 51 pages
[
«
|
242526272829303132
|
»
]