I am writing some tests. I am mocking entity framework. Yesterday worked everything correctly and I am almost sure I have not modified anything from yesterday. In the app.config of my test project I have this connection string
<connectionStrings>
<add name="PublicAreaContext"
providerName="System.Data.SqlClient" connectionString="Server=.\SQLSERVER; ..." />
</connectionStrings>
Now I mock my entity framework context:
var mockContext = new Mock<PublicAreaContext>() { CallBase = true };
... // all my entities mocked
mockContext.Setup(x => x.SaveChanges()).Returns(1);
Now when I start my test something goes wrong, and the context seems to be created using the wrong connection string
I do not understand where it takes that connection string... I looked for it in the solution SQLEXPRESS and I do not find anything. In my server (SQLSERVER) I can find a database called Castle.Proxy.PublicAreaContext. I think is the database created yesterday when everything worked.
Can you tell me what can be the problem or how can I set correctly the connection string?
Thank you