Skip to content

wrap an existing instance of an interface #1651

@jpribele

Description

@jpribele

What I want to do put a mock around around existing instance so I that I verify that the methods are called

IFoo foo = GetFoo();
var mock = new Mock( foo );
mock.Setup(....)

The only way I can see to this is to implement IFoo myself that wraps the foo instance and then do
new Mock(foo)

is there some other way to do this?

Back this issue
Back this issue

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions