mocks

package
v0.75.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 26, 2024 License: AGPL-3.0 Imports: 6 Imported by: 0

Documentation

Overview

Package mocks is a generated GoMock package.

Index

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

func (b *MockBroker) GetLastByTypeAndID(t events.Type, id string) events.Event

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

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) Ack

func (m *MockSubscriber) Ack() bool

Ack mocks base method.

func (*MockSubscriber) C

func (m *MockSubscriber) C() chan<- []events.Event

C mocks base method.

func (*MockSubscriber) Closed

func (m *MockSubscriber) Closed() <-chan struct{}

Closed mocks base method.

func (*MockSubscriber) EXPECT

EXPECT returns an object that allows the caller to indicate expected use.

func (*MockSubscriber) ID

func (m *MockSubscriber) ID() int

ID mocks base method.

func (*MockSubscriber) Push

func (m *MockSubscriber) Push(arg0 ...events.Event)

Push mocks base method.

func (*MockSubscriber) SetID

func (m *MockSubscriber) SetID(arg0 int)

SetID 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

Ack indicates an expected call of Ack.

func (*MockSubscriberMockRecorder) C

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

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

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 added in v0.55.0

type MockTestInterface struct {
	// contains filtered or unexported fields
}

MockTestInterface is a mock of TestInterface interface.

func NewMockTestInterface added in v0.55.0

func NewMockTestInterface(ctrl *gomock.Controller) *MockTestInterface

NewMockTestInterface creates a new mock instance.

func (*MockTestInterface) EXPECT added in v0.55.0

EXPECT returns an object that allows the caller to indicate expected use.

func (*MockTestInterface) Receive added in v0.55.0

func (m *MockTestInterface) Receive(arg0 context.Context) error

Receive mocks base method.

func (*MockTestInterface) Send added in v0.55.0

func (m *MockTestInterface) Send(arg0 events.Event)

Send mocks base method.

func (*MockTestInterface) Subscribe added in v0.55.0

func (m *MockTestInterface) Subscribe(arg0 broker.Subscriber) int

Subscribe mocks base method.

func (*MockTestInterface) SubscribeBatch added in v0.55.0

func (m *MockTestInterface) SubscribeBatch(arg0 ...broker.Subscriber)

SubscribeBatch mocks base method.

func (*MockTestInterface) Unsubscribe added in v0.55.0

func (m *MockTestInterface) Unsubscribe(arg0 int)

Unsubscribe mocks base method.

type MockTestInterfaceMockRecorder added in v0.55.0

type MockTestInterfaceMockRecorder struct {
	// contains filtered or unexported fields
}

MockTestInterfaceMockRecorder is the mock recorder for MockTestInterface.

func (*MockTestInterfaceMockRecorder) Receive added in v0.55.0

func (mr *MockTestInterfaceMockRecorder) Receive(arg0 interface{}) *gomock.Call

Receive indicates an expected call of Receive.

func (*MockTestInterfaceMockRecorder) Send added in v0.55.0

func (mr *MockTestInterfaceMockRecorder) Send(arg0 interface{}) *gomock.Call

Send indicates an expected call of Send.

func (*MockTestInterfaceMockRecorder) Subscribe added in v0.55.0

func (mr *MockTestInterfaceMockRecorder) Subscribe(arg0 interface{}) *gomock.Call

Subscribe indicates an expected call of Subscribe.

func (*MockTestInterfaceMockRecorder) SubscribeBatch added in v0.55.0

func (mr *MockTestInterfaceMockRecorder) SubscribeBatch(arg0 ...interface{}) *gomock.Call

SubscribeBatch indicates an expected call of SubscribeBatch.

func (*MockTestInterfaceMockRecorder) Unsubscribe added in v0.55.0

func (mr *MockTestInterfaceMockRecorder) Unsubscribe(arg0 interface{}) *gomock.Call

Unsubscribe indicates an expected call of Unsubscribe.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL