I have an object which hold a message in many language this is called a LookupString in my project.
I have also a repository for this entity which is LookupTableRepository which is implemented from ILookupTableRepository.
I have a service class which is called LookupTableProvider.. this is simply to call out the repository. It only got one method which is GetEntry(string id, cultureinfo culture) which enable to get a message in the specified culture i want.
Now i want to unit test the LookupTableProvider which hold a repository.. but i wish to use a fake repository for this purpose since a moq won’t help me much there since i only want to test the implementation of the provider.
What is the best way to make the unit test provider me an implementation of the fake repository if i use Ninject ? How i can call ninject to give me an instance of this fake repository ?
You shouldn’t use an IoC Container for unit testing your classes. Simply new up your Provider and pass all mocks to the constructor.