Skip to content

Resolve method doesn't register created instance #19

Description

@nimbusparis

While updating AutoFake from v 5.x to 6.0.0, many of my tests failed. It seems that the Resolve method for mock doesn't register it and I need to call Provide with the returned instance:

var instance = autoFake.Resolve<IInterface>();
var sut = autoFake.Resolve<SystemUnderTest>();

don't work, instance of IInterface injected in sut if not the same.

var instance = autoFake.Resolve<IInterface>();
autoFake.Provide(instance);
var sut = autoFake.Resolve<SystemUnderTest>();

Works

Could you have a look?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions