Documentation ¶
Overview ¶
Package mocks is a generated GoMock package.
Index ¶
- type MockBroker
- type MockChainInfoI
- type MockChainInfoIMockRecorder
- type MockSubscriber
- func (m *MockSubscriber) Ack() bool
- func (m *MockSubscriber) C() chan<- []events.Event
- func (m *MockSubscriber) Closed() <-chan struct{}
- func (m *MockSubscriber) EXPECT() *MockSubscriberMockRecorder
- func (m *MockSubscriber) ID() int
- func (m *MockSubscriber) Push(arg0 ...events.Event)
- func (m *MockSubscriber) SetID(arg0 int)
- func (m *MockSubscriber) Skip() <-chan struct{}
- func (m *MockSubscriber) Types() []events.Type
- type MockSubscriberMockRecorder
- func (mr *MockSubscriberMockRecorder) Ack() *gomock.Call
- func (mr *MockSubscriberMockRecorder) C() *gomock.Call
- func (mr *MockSubscriberMockRecorder) Closed() *gomock.Call
- func (mr *MockSubscriberMockRecorder) ID() *gomock.Call
- func (mr *MockSubscriberMockRecorder) Push(arg0 ...interface{}) *gomock.Call
- func (mr *MockSubscriberMockRecorder) SetID(arg0 interface{}) *gomock.Call
- func (mr *MockSubscriberMockRecorder) Skip() *gomock.Call
- func (mr *MockSubscriberMockRecorder) Types() *gomock.Call
- type MockTestInterface
- func (m *MockTestInterface) EXPECT() *MockTestInterfaceMockRecorder
- func (m *MockTestInterface) Receive(arg0 context.Context) error
- func (m *MockTestInterface) Send(arg0 events.Event)
- func (m *MockTestInterface) Subscribe(arg0 broker.Subscriber) int
- func (m *MockTestInterface) SubscribeBatch(arg0 ...broker.Subscriber)
- func (m *MockTestInterface) Unsubscribe(arg0 int)
- type MockTestInterfaceMockRecorder
- func (mr *MockTestInterfaceMockRecorder) Receive(arg0 interface{}) *gomock.Call
- func (mr *MockTestInterfaceMockRecorder) Send(arg0 interface{}) *gomock.Call
- func (mr *MockTestInterfaceMockRecorder) Subscribe(arg0 interface{}) *gomock.Call
- func (mr *MockTestInterfaceMockRecorder) SubscribeBatch(arg0 ...interface{}) *gomock.Call
- func (mr *MockTestInterfaceMockRecorder) Unsubscribe(arg0 interface{}) *gomock.Call
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type MockBroker ¶
type MockBroker struct { // embed the broker mock here... this is how we can end up with a drop-in replacement *MockTestInterface // contains filtered or unexported fields }
MockBroker - drop in mock that allows us to check the events themselves in unit tests (and as such ensure the state changes are correct) We're only overriding the Send and SendBatch functions. The way in which this is done shouldn't be a problem, even when using DoAndReturn, but you never know...
func NewMockBroker ¶
func NewMockBroker(ctrl *gomock.Controller) *MockBroker
func (*MockBroker) GetAllByType ¶
func (b *MockBroker) GetAllByType(t events.Type) []events.Event
GetAllByType returns all events of a given type the mock has received.
func (*MockBroker) GetLastByType ¶
func (b *MockBroker) GetLastByType(t events.Type) events.Event
GetLastByType returns the most recent event for a given type. If SendBatch was called, this is the last event of the batch.
func (*MockBroker) GetLastByTypeAndID ¶
GetLastByTypeAndID returns the last event of a given type, for a specific identified (party, market, order, etc...) list of implemented events - and ID's used:
- Order (by order ID)
- Account (by account ID)
- Asset (by asset ID)
- Auction (by market ID)
- Deposit (party ID)
- Proposal (proposal ID)
- LP (by party ID)
- MarginLevels (party ID)
- MarketData (market ID)
- PosRes (market ID)
- RiskFactor (market ID)
- SettleDistressed (party ID)
- Vote (currently PartyID, might want to use proposalID, too?)
- Withdrawal (PartyID)
func (*MockBroker) Send ¶
func (b *MockBroker) Send(event events.Event)
Send - first call Send on the underlying mock, then add the argument to the various maps.
type MockChainInfoI ¶
type MockChainInfoI struct {
// contains filtered or unexported fields
}
MockChainInfoI is a mock of ChainInfoI interface.
func NewMockChainInfoI ¶
func NewMockChainInfoI(ctrl *gomock.Controller) *MockChainInfoI
NewMockChainInfoI creates a new mock instance.
func (*MockChainInfoI) EXPECT ¶
func (m *MockChainInfoI) EXPECT() *MockChainInfoIMockRecorder
EXPECT returns an object that allows the caller to indicate expected use.
func (*MockChainInfoI) GetChainID ¶
func (m *MockChainInfoI) GetChainID() (string, error)
GetChainID mocks base method.
func (*MockChainInfoI) SetChainID ¶
func (m *MockChainInfoI) SetChainID(arg0 string) error
SetChainID mocks base method.
type MockChainInfoIMockRecorder ¶
type MockChainInfoIMockRecorder struct {
// contains filtered or unexported fields
}
MockChainInfoIMockRecorder is the mock recorder for MockChainInfoI.
func (*MockChainInfoIMockRecorder) GetChainID ¶
func (mr *MockChainInfoIMockRecorder) GetChainID() *gomock.Call
GetChainID indicates an expected call of GetChainID.
func (*MockChainInfoIMockRecorder) SetChainID ¶
func (mr *MockChainInfoIMockRecorder) SetChainID(arg0 interface{}) *gomock.Call
SetChainID indicates an expected call of SetChainID.
type MockSubscriber ¶
type MockSubscriber struct {
// contains filtered or unexported fields
}
MockSubscriber is a mock of Subscriber interface.
func NewMockSubscriber ¶
func NewMockSubscriber(ctrl *gomock.Controller) *MockSubscriber
NewMockSubscriber creates a new mock instance.
func (*MockSubscriber) Closed ¶
func (m *MockSubscriber) Closed() <-chan struct{}
Closed mocks base method.
func (*MockSubscriber) EXPECT ¶
func (m *MockSubscriber) EXPECT() *MockSubscriberMockRecorder
EXPECT returns an object that allows the caller to indicate expected use.
func (*MockSubscriber) Push ¶
func (m *MockSubscriber) Push(arg0 ...events.Event)
Push mocks base method.
func (*MockSubscriber) Skip ¶
func (m *MockSubscriber) Skip() <-chan struct{}
Skip mocks base method.
func (*MockSubscriber) Types ¶
func (m *MockSubscriber) Types() []events.Type
Types mocks base method.
type MockSubscriberMockRecorder ¶
type MockSubscriberMockRecorder struct {
// contains filtered or unexported fields
}
MockSubscriberMockRecorder is the mock recorder for MockSubscriber.
func (*MockSubscriberMockRecorder) Ack ¶
func (mr *MockSubscriberMockRecorder) Ack() *gomock.Call
Ack indicates an expected call of Ack.
func (*MockSubscriberMockRecorder) C ¶
func (mr *MockSubscriberMockRecorder) C() *gomock.Call
C indicates an expected call of C.
func (*MockSubscriberMockRecorder) Closed ¶
func (mr *MockSubscriberMockRecorder) Closed() *gomock.Call
Closed indicates an expected call of Closed.
func (*MockSubscriberMockRecorder) ID ¶
func (mr *MockSubscriberMockRecorder) ID() *gomock.Call
ID indicates an expected call of ID.
func (*MockSubscriberMockRecorder) Push ¶
func (mr *MockSubscriberMockRecorder) Push(arg0 ...interface{}) *gomock.Call
Push indicates an expected call of Push.
func (*MockSubscriberMockRecorder) SetID ¶
func (mr *MockSubscriberMockRecorder) SetID(arg0 interface{}) *gomock.Call
SetID indicates an expected call of SetID.
func (*MockSubscriberMockRecorder) Skip ¶
func (mr *MockSubscriberMockRecorder) Skip() *gomock.Call
Skip indicates an expected call of Skip.
func (*MockSubscriberMockRecorder) Types ¶
func (mr *MockSubscriberMockRecorder) Types() *gomock.Call
Types indicates an expected call of Types.
type MockTestInterface ¶
type MockTestInterface struct {
// contains filtered or unexported fields
}
MockTestInterface is a mock of TestInterface interface.
func NewMockTestInterface ¶
func NewMockTestInterface(ctrl *gomock.Controller) *MockTestInterface
NewMockTestInterface creates a new mock instance.
func (*MockTestInterface) EXPECT ¶
func (m *MockTestInterface) EXPECT() *MockTestInterfaceMockRecorder
EXPECT returns an object that allows the caller to indicate expected use.
func (*MockTestInterface) Receive ¶
func (m *MockTestInterface) Receive(arg0 context.Context) error
Receive mocks base method.
func (*MockTestInterface) Send ¶
func (m *MockTestInterface) Send(arg0 events.Event)
Send mocks base method.
func (*MockTestInterface) Subscribe ¶
func (m *MockTestInterface) Subscribe(arg0 broker.Subscriber) int
Subscribe mocks base method.
func (*MockTestInterface) SubscribeBatch ¶
func (m *MockTestInterface) SubscribeBatch(arg0 ...broker.Subscriber)
SubscribeBatch mocks base method.
func (*MockTestInterface) Unsubscribe ¶
func (m *MockTestInterface) Unsubscribe(arg0 int)
Unsubscribe mocks base method.
type MockTestInterfaceMockRecorder ¶
type MockTestInterfaceMockRecorder struct {
// contains filtered or unexported fields
}
MockTestInterfaceMockRecorder is the mock recorder for MockTestInterface.
func (*MockTestInterfaceMockRecorder) Receive ¶
func (mr *MockTestInterfaceMockRecorder) Receive(arg0 interface{}) *gomock.Call
Receive indicates an expected call of Receive.
func (*MockTestInterfaceMockRecorder) Send ¶
func (mr *MockTestInterfaceMockRecorder) Send(arg0 interface{}) *gomock.Call
Send indicates an expected call of Send.
func (*MockTestInterfaceMockRecorder) Subscribe ¶
func (mr *MockTestInterfaceMockRecorder) Subscribe(arg0 interface{}) *gomock.Call
Subscribe indicates an expected call of Subscribe.
func (*MockTestInterfaceMockRecorder) SubscribeBatch ¶
func (mr *MockTestInterfaceMockRecorder) SubscribeBatch(arg0 ...interface{}) *gomock.Call
SubscribeBatch indicates an expected call of SubscribeBatch.
func (*MockTestInterfaceMockRecorder) Unsubscribe ¶
func (mr *MockTestInterfaceMockRecorder) Unsubscribe(arg0 interface{}) *gomock.Call
Unsubscribe indicates an expected call of Unsubscribe.