arping.go 1.3 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. ARPing struct {
  14. m *mock.Mock
  15. t *testing.T
  16. }
  17. ARPingPingFunc func(ctx context.Context, ifi, hw, ip string) (bool, error)
  18. ARPingCountFunc func(count uint)
  19. )
  20. func NewARPing(t *testing.T) *ARPing {
  21. var (
  22. m = &ARPing{mock.New(), t}
  23. _ neighbors.ARPing = m
  24. )
  25. return m
  26. }
  27. func (m *ARPing) AddPing(f ARPingPingFunc) {
  28. m.m.Add("Ping", f)
  29. }
  30. func (m *ARPing) SetPing(f ARPingPingFunc) {
  31. m.m.Set("Ping", f)
  32. }
  33. func (m *ARPing) Ping(ctx context.Context, ifi, hw, ip string) (bool, error) {
  34. if f := m.m.Next("Ping"); f != nil {
  35. return f.(ARPingPingFunc)(ctx, ifi, hw, ip)
  36. }
  37. m.t.Helper()
  38. m.t.Error("unexpected Ping call")
  39. return false, nil
  40. }
  41. func (m *ARPing) AddCount(f ARPingCountFunc) {
  42. m.m.Add("Count", f)
  43. }
  44. func (m *ARPing) SetCount(f ARPingCountFunc) {
  45. m.m.Set("Count", f)
  46. }
  47. func (m *ARPing) Count(count uint) {
  48. if f := m.m.Next("Count"); f != nil {
  49. f.(ARPingCountFunc)(count)
  50. return
  51. }
  52. m.t.Helper()
  53. m.t.Error("unexpected Count call")
  54. }
  55. func (m *ARPing) HasMore() bool {
  56. return m.m.HasMore()
  57. }