Ejemplo n.º 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)
}
Ejemplo n.º 2
0
func readDocument(a *assert.Assertions, file string) Document {

	var document Document

	out, err := ioutil.ReadFile(file)
	a.NoError(err)

	err = yaml.Unmarshal(out, &document.stack)
	a.NoError(err)
	a.NotEmpty(document.stack)

	return document

}