Documentation ¶
Index ¶
- type BasicMock
- func (mock *BasicMock) Exs(key string) bool
- func (mock *BasicMock) ExsCalls() []struct{ ... }
- func (mock *BasicMock) Get(key string) interface{}
- func (mock *BasicMock) GetCalls() []struct{ ... }
- func (mock *BasicMock) Set(key string, value interface{})
- func (mock *BasicMock) SetCalls() []struct{ ... }
- func (mock *BasicMock) SetEX(key string, value interface{}) (interface{}, bool)
- func (mock *BasicMock) SetEXCalls() []struct{ ... }
- type ExchangeMock
- func (mock *ExchangeMock) Get(symbol string) (*exchange.Symbol, error)
- func (mock *ExchangeMock) GetCalls() []struct{ ... }
- func (mock *ExchangeMock) Set(symbols []*exchange.Symbol)
- func (mock *ExchangeMock) SetCalls() []struct{ ... }
- func (mock *ExchangeMock) Symbols() []string
- func (mock *ExchangeMock) SymbolsCalls() []struct{}
- type MarketMock
- func (mock *MarketMock) CandleSummary(symbol string) (*market.CandleSummary, error)
- func (mock *MarketMock) CandleSummaryCalls() []struct{ ... }
- func (mock *MarketMock) CreateSummary(symbol string) *market.CandleSummary
- func (mock *MarketMock) CreateSummaryCalls() []struct{ ... }
- func (mock *MarketMock) UpdateSummary(symbol string) *market.CandleSummary
- func (mock *MarketMock) UpdateSummaryCalls() []struct{ ... }
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BasicMock ¶
type BasicMock struct { // ExsFunc mocks the Exs method. ExsFunc func(key string) bool // GetFunc mocks the Get method. GetFunc func(key string) interface{} // SetFunc mocks the Set method. SetFunc func(key string, value interface{}) // SetEXFunc mocks the SetEX method. SetEXFunc func(key string, value interface{}) (interface{}, bool) // contains filtered or unexported fields }
BasicMock is a mock implementation of cache.Basic.
func TestSomethingThatUsesBasic(t *testing.T) { // make and configure a mocked cache.Basic mockedBasic := &BasicMock{ ExsFunc: func(key string) bool { panic("mock out the Exs method") }, GetFunc: func(key string) interface{} { panic("mock out the Get method") }, SetFunc: func(key string, value interface{}) { panic("mock out the Set method") }, SetEXFunc: func(key string, value interface{}) (interface{}, bool) { panic("mock out the SetEX method") }, } // use mockedBasic in code that requires cache.Basic // and then make assertions. }
func (*BasicMock) ExsCalls ¶
ExsCalls gets all the calls that were made to Exs. Check the length with:
len(mockedBasic.ExsCalls())
func (*BasicMock) GetCalls ¶
GetCalls gets all the calls that were made to Get. Check the length with:
len(mockedBasic.GetCalls())
func (*BasicMock) SetCalls ¶
SetCalls gets all the calls that were made to Set. Check the length with:
len(mockedBasic.SetCalls())
func (*BasicMock) SetEXCalls ¶
SetEXCalls gets all the calls that were made to SetEX. Check the length with:
len(mockedBasic.SetEXCalls())
type ExchangeMock ¶
type ExchangeMock struct { // GetFunc mocks the Get method. GetFunc func(symbol string) (*exchange.Symbol, error) // SetFunc mocks the Set method. SetFunc func(symbols []*exchange.Symbol) // SymbolsFunc mocks the Symbols method. SymbolsFunc func() []string // contains filtered or unexported fields }
ExchangeMock is a mock implementation of cache.Exchange.
func TestSomethingThatUsesExchange(t *testing.T) { // make and configure a mocked cache.Exchange mockedExchange := &ExchangeMock{ GetFunc: func(symbol string) (*exchange.Symbol, error) { panic("mock out the Get method") }, SetFunc: func(symbols []*exchange.Symbol) { panic("mock out the Set method") }, SymbolsFunc: func() []string { panic("mock out the Symbols method") }, } // use mockedExchange in code that requires cache.Exchange // and then make assertions. }
func (*ExchangeMock) Get ¶
func (mock *ExchangeMock) Get(symbol string) (*exchange.Symbol, error)
Get calls GetFunc.
func (*ExchangeMock) GetCalls ¶
func (mock *ExchangeMock) GetCalls() []struct { Symbol string }
GetCalls gets all the calls that were made to Get. Check the length with:
len(mockedExchange.GetCalls())
func (*ExchangeMock) Set ¶
func (mock *ExchangeMock) Set(symbols []*exchange.Symbol)
Set calls SetFunc.
func (*ExchangeMock) SetCalls ¶
func (mock *ExchangeMock) SetCalls() []struct { Symbols []*exchange.Symbol }
SetCalls gets all the calls that were made to Set. Check the length with:
len(mockedExchange.SetCalls())
func (*ExchangeMock) Symbols ¶
func (mock *ExchangeMock) Symbols() []string
Symbols calls SymbolsFunc.
func (*ExchangeMock) SymbolsCalls ¶
func (mock *ExchangeMock) SymbolsCalls() []struct { }
SymbolsCalls gets all the calls that were made to Symbols. Check the length with:
len(mockedExchange.SymbolsCalls())
type MarketMock ¶
type MarketMock struct { // CandleSummaryFunc mocks the CandleSummary method. CandleSummaryFunc func(symbol string) (*market.CandleSummary, error) // CreateSummaryFunc mocks the CreateSummary method. CreateSummaryFunc func(symbol string) *market.CandleSummary // UpdateSummaryFunc mocks the UpdateSummary method. UpdateSummaryFunc func(symbol string) *market.CandleSummary // contains filtered or unexported fields }
MarketMock is a mock implementation of cache.Market.
func TestSomethingThatUsesMarket(t *testing.T) { // make and configure a mocked cache.Market mockedMarket := &MarketMock{ CandleSummaryFunc: func(symbol string) (*market.CandleSummary, error) { panic("mock out the CandleSummary method") }, CreateSummaryFunc: func(symbol string) *market.CandleSummary { panic("mock out the CreateSummary method") }, UpdateSummaryFunc: func(symbol string) *market.CandleSummary { panic("mock out the UpdateSummary method") }, } // use mockedMarket in code that requires cache.Market // and then make assertions. }
func (*MarketMock) CandleSummary ¶
func (mock *MarketMock) CandleSummary(symbol string) (*market.CandleSummary, error)
CandleSummary calls CandleSummaryFunc.
func (*MarketMock) CandleSummaryCalls ¶
func (mock *MarketMock) CandleSummaryCalls() []struct { Symbol string }
CandleSummaryCalls gets all the calls that were made to CandleSummary. Check the length with:
len(mockedMarket.CandleSummaryCalls())
func (*MarketMock) CreateSummary ¶
func (mock *MarketMock) CreateSummary(symbol string) *market.CandleSummary
CreateSummary calls CreateSummaryFunc.
func (*MarketMock) CreateSummaryCalls ¶
func (mock *MarketMock) CreateSummaryCalls() []struct { Symbol string }
CreateSummaryCalls gets all the calls that were made to CreateSummary. Check the length with:
len(mockedMarket.CreateSummaryCalls())
func (*MarketMock) UpdateSummary ¶
func (mock *MarketMock) UpdateSummary(symbol string) *market.CandleSummary
UpdateSummary calls UpdateSummaryFunc.
func (*MarketMock) UpdateSummaryCalls ¶
func (mock *MarketMock) UpdateSummaryCalls() []struct { Symbol string }
UpdateSummaryCalls gets all the calls that were made to UpdateSummary. Check the length with:
len(mockedMarket.UpdateSummaryCalls())