lundi 9 mars 2015

Effort Unit test: Argument 'xmlReader' is not valid

I'm currently trying to unit test a context class of the Entity Framework with the "Effort" framework (http://ift.tt/194Jd89)


If my unit test project has two classes that contain methods use effort then i get the following error:


Argument 'xmlReader' is not valid. A minimum of one .ssdl artifact must be supplied.


It appears to be that having the than one method using effort across more than one class causes the error. I rather not have all my unit test functions in one class.


Code the test is running: IDataLoader loader = new Effort.DataLoaders.CsvDataLoader(Path.Combine(TestContext.DeploymentDirectory, "csvFiles"));



using (EntityConnection connection = Effort.EntityConnectionFactory.CreateTransient("name=Entities", loader))
{
BussinnesLayer.Customer[] customers = Customer.GetCustomers(connection);
Assert.IsTrue(customers.Length > 0, "Customer list length = 0");
}


App.Config contains the following for the entity connection string: (removed sensitive data)



<add name="Entities" connectionString="metadata=http://res*/Model.csdl|res*/Model.ssdl|res*/Model.msl;provider=System.Data.SqlClient;provider connection string=&quot;data source=servername;initial catalog=database;integrated security=True;MultipleActiveResultSets=True;App=EntityFramework&quot;" providerName="System.Data.EntityClient" />


Any help would be appreciated.


Aucun commentaire:

Enregistrer un commentaire