client.go 971 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. // Code generated by Clue Mock Generator v0.17.0, DO NOT EDIT.
  2. //
  3. // Command:
  4. // $ cmg gen douglasthrift.net/presence/ifttt
  5. package mockifttt
  6. import (
  7. "context"
  8. "testing"
  9. "goa.design/clue/mock"
  10. "douglasthrift.net/presence/ifttt"
  11. )
  12. type (
  13. Client struct {
  14. m *mock.Mock
  15. t *testing.T
  16. }
  17. ClientTriggerFunc func(ctx context.Context, present bool) (event string, err error)
  18. )
  19. func NewClient(t *testing.T) *Client {
  20. var (
  21. m = &Client{mock.New(), t}
  22. _ ifttt.Client = m
  23. )
  24. return m
  25. }
  26. func (m *Client) AddTrigger(f ClientTriggerFunc) {
  27. m.m.Add("Trigger", f)
  28. }
  29. func (m *Client) SetTrigger(f ClientTriggerFunc) {
  30. m.m.Set("Trigger", f)
  31. }
  32. func (m *Client) Trigger(ctx context.Context, present bool) (event string, err error) {
  33. if f := m.m.Next("Trigger"); f != nil {
  34. return f.(ClientTriggerFunc)(ctx, present)
  35. }
  36. m.t.Helper()
  37. m.t.Error("unexpected Trigger call")
  38. return "", nil
  39. }
  40. func (m *Client) HasMore() bool {
  41. return m.m.HasMore()
  42. }