Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

4
  • one quick question, do you want to write unit test for ConfigurationFactory or some other class which depends on ConfigurationFactory. If some other class then definitely you can try the mocking frameworks. Commented May 9, 2012 at 7:10
  • No, it is just to test ConfigurationFactory. The tests are, for example, loading a config from a file, loading from database, etc.. Commented May 9, 2012 at 7:13
  • Ahh..I see, then the mock's will be helpful in mocking the configs. If the constructor of this class is not doing the purpose of loading all those then you can definitely write unit tests for this class. You can return mock objects for the methods getConfiguration and do the asserts. Commented May 9, 2012 at 7:18
  • It seems that chances are using DI or this, so I'll accept it Commented May 10, 2012 at 8:32