本文整理汇总了Golang中github.com/stretchr/testify/assert.Assertions.NotEmpty方法的典型用法代码示例。如果您正苦于以下问题:Golang Assertions.NotEmpty方法的具体用法?Golang Assertions.NotEmpty怎么用?Golang Assertions.NotEmpty使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类github.com/stretchr/testify/assert.Assertions
的用法示例。
在下文中一共展示了Assertions.NotEmpty方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Golang代码示例。
示例1: assertInstrument
// 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)
}
示例2: readDocument
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
}