Search code examples
mspec

MSpec and testing class using appsettings within an app.conf issues


I'm very new to MSpec and BDD in general and are currently having trouble having mspec pass a Search class that looks up employee data via an XML feed. The parameters for the url are held in an app.config file and seems as if the app.config is not being accessed to obtain the config setting.

Otherwise mspec is running fine for all other tests so far its just this one particular.

How do I write a test to utilise or mimic if thats needed, for the config file access please ?

Thanks


Solution

  • You probably have app.config in your production code project (project which is being tested), try adding the same app.config in Tests (project with MSpecs).