arp.go 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. // Code generated by Clue Mock Generator v0.17.0, DO NOT EDIT.
  2. //
  3. // Command:
  4. // $ cmg gen douglasthrift.net/presence/neighbors
  5. package mockneighbors
  6. import (
  7. "context"
  8. "testing"
  9. "goa.design/clue/mock"
  10. "douglasthrift.net/presence/neighbors"
  11. )
  12. type (
  13. ARP struct {
  14. m *mock.Mock
  15. t *testing.T
  16. }
  17. ARPPresentFunc func(ctx context.Context, ifs neighbors.Interfaces, state neighbors.State, addrStates neighbors.HardwareAddrStates) error
  18. ARPCountFunc func(count uint)
  19. )
  20. func NewARP(t *testing.T) *ARP {
  21. var (
  22. m = &ARP{mock.New(), t}
  23. _ neighbors.ARP = m
  24. )
  25. return m
  26. }
  27. func (m *ARP) AddPresent(f ARPPresentFunc) {
  28. m.m.Add("Present", f)
  29. }
  30. func (m *ARP) SetPresent(f ARPPresentFunc) {
  31. m.m.Set("Present", f)
  32. }
  33. func (m *ARP) Present(ctx context.Context, ifs neighbors.Interfaces, state neighbors.State, addrStates neighbors.HardwareAddrStates) error {
  34. if f := m.m.Next("Present"); f != nil {
  35. return f.(ARPPresentFunc)(ctx, ifs, state, addrStates)
  36. }
  37. m.t.Helper()
  38. m.t.Error("unexpected Present call")
  39. return nil
  40. }
  41. func (m *ARP) AddCount(f ARPCountFunc) {
  42. m.m.Add("Count", f)
  43. }
  44. func (m *ARP) SetCount(f ARPCountFunc) {
  45. m.m.Set("Count", f)
  46. }
  47. func (m *ARP) Count(count uint) {
  48. if f := m.m.Next("Count"); f != nil {
  49. f.(ARPCountFunc)(count)
  50. return
  51. }
  52. m.t.Helper()
  53. m.t.Error("unexpected Count call")
  54. }
  55. func (m *ARP) HasMore() bool {
  56. return m.m.HasMore()
  57. }