Hi! I need to mock an interface which has a method called On.
type MyMockedObj struct {}
func (obj *MyMockedObj) On() error {
arguments := obj.Called()
return arguments.Error(0)
}
func TestThis() {
obj := Obj{}
obj.On("On").Return(nil) // Error: obj.On("On").Return undefined (type error has no field or method Return)
}
How I supposed to do that?
Hi! I need to mock an interface which has a method called On.
How I supposed to do that?