Example #1
0
// Assert Instrument type
func assertInstrument(assert *assert.Assertions, instrument *Instrument) {
	assert.EqualValues(123, instrument.InstrumentId)

	assert.NotEmpty(instrument.Tradables)
	tradable := instrument.Tradables[0]

	assert.EqualValues(123, tradable.MarketId)
	assert.Equal("test", tradable.Identifier)
	assert.EqualValues(123, tradable.TickSizeId)
	assert.Equal(1.1, tradable.LotSize)
	assert.EqualValues(123, tradable.DisplayOrder)

	assert.Equal("test", instrument.Currency)
	assert.Equal("test", instrument.InstrumentGroupType)
	assert.Equal("test", instrument.InstrumentType)
	assert.Equal(1.1, instrument.Multiplier)
	assert.Equal("test", instrument.Symbol)
	assert.Equal("test", instrument.IsinCode)
	assert.Equal("test", instrument.MarketView)
	assert.Equal(1.1, instrument.StrikePrice)
	assert.Equal(1.1, instrument.NumberOfSecurities)
	assert.Equal("test", instrument.ProspectusUrl)
	assert.Equal("test", instrument.ExpirationDate)
	assert.Equal("test", instrument.Name)
	assert.Equal("test", instrument.Sector)
	assert.Equal("test", instrument.SectorGroup)

	assert.NotEmpty(instrument.Underlyings)
	underlying := instrument.Underlyings[0]

	assert.EqualValues(123, underlying.InstrumentId)
	assert.Equal("test", underlying.Symbol)
	assert.Equal("test", underlying.IsinCode)
}
Example #2
0
// Assert Indicator type
func assertIndicator(assert *assert.Assertions, indicator *Indicator) {
	assert.Equal("test", indicator.Name)
	assert.Equal("test", indicator.Src)
	assert.Equal("test", indicator.Identifier)
	assert.EqualValues(123, indicator.Delayed)
	assert.Equal(true, indicator.OnlyEod)
	assert.Equal("test", indicator.Open)
	assert.Equal("test", indicator.Close)
	assert.Equal("test", indicator.Country)
	assert.Equal("test", indicator.Type)
	assert.Equal("test", indicator.Region)
	assert.EqualValues(123, indicator.InstrumentId)
}
Example #3
0
// Assert Order type
func assertOrder(assert *assert.Assertions, order *OrderReply) {
	assert.EqualValues(123, order.OrderId)
	assert.Equal("test", order.ResultCode)
	assert.Equal("test", order.OrderState)
	assert.Equal("test", order.ActionState)
	assert.Equal("test", order.Message)
}