Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

MEF creates trouble for integration tests #392

Copy link
Copy link
@fallwest

Description

@fallwest
Issue body actions

I have to fight with MEF on my sever run of unit / integration tests. I have got past not finding the Ado provider with the code sample below but then run up against "SimpleDataException:

Simple.Data.SimpleDataException: No System.Data.SqlClient Provider found.. at Simple.Data.MefHelper.Compose[T](String contractName)" 

Would rather have feature that allows me to circumvent MEF for testing.

        [ClassInitialize]
        public static void ClassInitialize(TestContext testContext)
        {
            //Hack to avoid strange error that only occurs on automatic test server.
            //Error message: Simple.Data.SimpleDataException: No Ado Provider found. at Simple.Data.MefHelper.Compose[T](String contractName)
            var adoAdapter = new AdoAdapter();
            adoAdapter.Setup(new
            {
                ConnectionString = "Data Source=(local);Initial Catalog=DB;Integrated Security=True;User Instance=False",
                ProviderName = "System.Data.SqlClient"
            });

            Database.UseMockAdapter(adoAdapter);
        }

I have, of course, added all nuget packages to the test project.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.