1
0
mirror of https://github.com/eventials/goevents.git synced 2025-05-02 22:17:09 +08:00
eventials.goevents/mock/consumer.go

31 lines
559 B
Go
Raw Normal View History

2016-12-01 11:40:58 -02:00
package mock
import (
"github.com/eventials/goevents/messaging"
"github.com/stretchr/testify/mock"
)
type Consumer struct {
mock.Mock
}
func (c *Consumer) Subscribe(action string, handler messaging.EventHandler) error {
args := c.Called(action, handler)
return args.Error(1)
}
func (c *Consumer) Unsubscribe(action string) error {
args := c.Called(action)
return args.Error(1)
}
func (c *Consumer) Listen() error {
args := c.Called()
2016-12-01 16:57:16 -02:00
return args.Error(1)
2016-12-01 11:40:58 -02:00
}
func (c *Consumer) ListenForever() error {
args := c.Called()
2016-12-01 16:57:16 -02:00
return args.Error(1)
2016-12-01 11:40:58 -02:00
}