From: Chris S. <cst...@sd...> - 2003-04-22 21:50:33
|
Hello, I'd like to be able to use MockObjects with a fairly complicated FileFilter-implementing class. In particular, I'd like to be able to set up a pseudo-directory tree (thanks to MockFile) and then verify that everything found is as it should be. However, I find that the class I want to test can't take a File as an argument to the method that searches the directory, because then I can't use a MockFile (similarly, the FileFilter-implementing class can't have an accept(MockFile mf) since that doesn't fulfil the interface). Is the right thing to have two versions of each method, or to implement some interface (MyFile) with a class that delegates to a real File in real code, and a MockFile in testing? Thanks, --chris sterritt |