unit testing - TDD - How to test .Read() without .Write()? -
we're trying use tdd create our system , we've come situation can't figure out right tdd course of action is. we've hidden file io behind interface so: public interface ifileio { byte[] read(string filename); void write(string filename, byte[] data); } and we're creating inmemoryfileio can use in place of real systemfileio class we'll use production. we want make sure inmemoryfileio works correctly , there may cases want use in lieu of actual file system, should "production quality". the question is, doing "right tdd way", how can create test either .read() or .write() don't depend on each other? in order test .read() worked correctly, have needed made call .write() first, , similarly, test .write() works correctly need call .read() afterwards. doing this, we've created same test twice (arrange, write, read, asserts). lets have 2 tests, 1 tests .read() , 1 tests .write() . if either of functions doe