Reputation: 503
I'm trying to setup a CI Build Definition in visual studio team services that runs a number of tests. I currently have these tests setup with xUnit (as shown below).
These tests use the Entity Framework's in-memory relational sql database. The test classes extend the below code and manipulate the database using the DbContext variable (see below).
When the tests are run locally, they all pass and perform fine. When the build is run on the online CI platform, while the build succeeds using the hosted VS2017 agent, all of the tests fail due to the below error.
We still wish to use the online hosted agents as an on-premisis agents (which I understand are a bit more configurable) won't necessarily be suitable.
Thanks in advance :)
Upvotes: 0
Views: 1308
Reputation: 33698
Based on your code, you are using UserSqlServer
method that is used for SQL database, you need to call UseInMemoryDatabase
method.
Upvotes: 2