Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AutoMoq not working anymore with registered type in container #38

Open
LoOnGitH opened this issue Jul 11, 2017 · 0 comments
Open

AutoMoq not working anymore with registered type in container #38

LoOnGitH opened this issue Jul 11, 2017 · 0 comments

Comments

@LoOnGitH
Copy link

I just upgraded from version 1.6.2 to version 2.0 and a lot of my unit tests are now failing because AutoMoq seems to not take into account types that are directly registered in the container.

As an example, this test is working fine with version 1.6.2 but is failing in version 2.0. Now, obj is of type IFooProxy, just like IFoo was not registered.

    [Test]
    public void Test_With_My_Container()
    {
        var container = new UnityContainer();
        var mocker = new AutoMoqer(container);
        // container.Resolve<IFoo>(); // If uncommenting this line, test pass

        container.RegisterType<IFoo, Foo>();
        var obj = container.Resolve<IFoo>();
        obj.ShouldBeType<Foo>();
    }

Am I missing something ?

Thanks !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant