1

I stumbled across a need to create a thin I/O Layer interface to abstract away a class from the need to know about I/O

public interface IFileIOProvider {
    Task WriteFileAsync(String contents, String path);
    Task<String> ReadFileAsync(String path);
}

Is it a good idea to test a default implementation that only falls back to standard .Net System.IO classes, no logic attached?. I think it might be overkill, but just want to get my strategy checked out by more experienced programmers

1
  • You don't have the luxury of testing everything; test the things that have a meaningful chance of being wrong.
    – Doval
    Commented Jul 9, 2014 at 14:26

1 Answer 1

2

First of all this should be tested by system/acceptance tests that cover what ever feature needs this class

for unit tests I'd say the answer is mostly no, there is nothing useful to test here, the only time I would unit test is if it was more effort to justify why I'm not testing this class than to test it (sometimes the case with safety related stuff)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.