1

Hi I'm new to EF but am trying to go by the book and create tests for my repositories. The tests fails here.

desiner.cs base(global::System.Configuration.ConfigurationManager.ConnectionStrings["pij_localConnectionString"].ConnectionString, mappingSource)

I presume I need to move the connection strings out of the webconfig. What is the normal protocol/method for doing this?

1 Answer 1

2

If you have created a unit test project and start testing from there then you just need to copy your connection string (pij_localConnectionString) to the app.config file of your test project. Basically any connection string data should be exist in the config file of the project that the .Net threads are initiated from by CLR (i.e. your startup project). You don't need to remove it from your web.config by the way.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.