123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106 |
- // Code generated by Clue Mock Generator v0.17.0, DO NOT EDIT.
- //
- // Command:
- // $ cmg gen douglasthrift.net/presence/neighbors
- package mockneighbors
- import (
- "testing"
- "goa.design/clue/mock"
- "douglasthrift.net/presence/neighbors"
- )
- type (
- State struct {
- m *mock.Mock
- t *testing.T
- }
- StatePresentFunc func() bool
- StateChangedFunc func() bool
- StateSetFunc func(present bool)
- StateResetFunc func()
- )
- func NewState(t *testing.T) *State {
- var (
- m = &State{mock.New(), t}
- _ neighbors.State = m
- )
- return m
- }
- func (m *State) AddPresent(f StatePresentFunc) {
- m.m.Add("Present", f)
- }
- func (m *State) SetPresent(f StatePresentFunc) {
- m.m.Set("Present", f)
- }
- func (m *State) Present() bool {
- if f := m.m.Next("Present"); f != nil {
- return f.(StatePresentFunc)()
- }
- m.t.Helper()
- m.t.Error("unexpected Present call")
- return false
- }
- func (m *State) AddChanged(f StateChangedFunc) {
- m.m.Add("Changed", f)
- }
- func (m *State) SetChanged(f StateChangedFunc) {
- m.m.Set("Changed", f)
- }
- func (m *State) Changed() bool {
- if f := m.m.Next("Changed"); f != nil {
- return f.(StateChangedFunc)()
- }
- m.t.Helper()
- m.t.Error("unexpected Changed call")
- return false
- }
- func (m *State) AddSet(f StateSetFunc) {
- m.m.Add("Set", f)
- }
- func (m *State) SetSet(f StateSetFunc) {
- m.m.Set("Set", f)
- }
- func (m *State) Set(present bool) {
- if f := m.m.Next("Set"); f != nil {
- f.(StateSetFunc)(present)
- return
- }
- m.t.Helper()
- m.t.Error("unexpected Set call")
- }
- func (m *State) AddReset(f StateResetFunc) {
- m.m.Add("Reset", f)
- }
- func (m *State) SetReset(f StateResetFunc) {
- m.m.Set("Reset", f)
- }
- func (m *State) Reset() {
- if f := m.m.Next("Reset"); f != nil {
- f.(StateResetFunc)()
- return
- }
- m.t.Helper()
- m.t.Error("unexpected Reset call")
- }
- func (m *State) HasMore() bool {
- return m.m.HasMore()
- }
|