Skip to content

How to specify returning a value given a specific argument? #155

@chintanparikh

Description

@chintanparikh

Hi -

I have an interface with a method that is called multiple times where I can't guarantee the order it's called in. However, the arguments on each call are different. Is there any way for me to specify a return value for specific arguments? E.g. something like:

interface Adder {
	Add(a int, b int) c int
}

fakeAdder.ReturnsWithArguments(1, 1, 3)

This would return 3 whenever someone calls adder.Add(1, 1)

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