Skip to content

Cannot SetInstance different objects implementing same interface #22

Description

@aateeque

The SetInstance<T>(T instance) method of AutoMoqer is designed to inject specific objects. Given a constructor with parameters of the same IType the last SetInstance call will override any previous objects. This is a major flaw in the framework.
An example
A common case is for a ViewModel depending on two IScheduler's the background and the dispatcher. In your ViewModelTest you'd want to have different schedulers passed in, but this is not possible.

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