Documentation ¶
Index ¶
- func AppendAll(content ...[]byte) []byte
- func AssertContains(t testing.TB, slice interface{}, value interface{})
- func AssertContainsAll(t testing.TB, sliceActual interface{}, sliceExpected interface{})
- func AssertEquals(t testing.TB, actual interface{}, expected interface{})
- func AssertError(t testing.TB, err error, message string)
- func AssertNil(t testing.TB, value interface{})
- func AssertNoError(t testing.TB, err error, message string)
- func AssertNotEquals(t testing.TB, actual interface{}, expected interface{})
- func AssertNotNil(t testing.TB, value interface{})
- func AssertPanic(t testing.TB, msg string)
- func AssertSame(t testing.TB, actual interface{}, expected interface{})
- func ComputeCryptoHash(content ...[]byte) []byte
- func ConstructBlock(t *testing.T, simulationResults [][]byte, sign bool) *common.Block
- func ConstructRandomBytes(t testing.TB, size int) []byte
- func ConstructTestBlock(t *testing.T, numTx int, txSize int) *common.Block
- func ConstructTestBlocks(t *testing.T, numBlocks int) []*common.Block
- func ConstructTransaction(t *testing.T, simulationResults []byte, sign bool) (*common.Envelope, string, error)
- func Contains(slice interface{}, value interface{}) bool
- func GenerateID(t *testing.T) string
- func ParseTestParams() []string
- func ResetConfigToDefaultValues()
- func SetLogLevel(level logging.Level, module string)
- func SetupCoreYAMLConfig(coreYamlPath string)
- func SetupTestConfig()
- type BlockGenerator
- type TestRandomNumberGenerator
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AssertContains ¶
AssertContains varifies that the slice contains the value
func AssertContainsAll ¶
AssertContainsAll varifies that sliceActual is a superset of sliceExpected
func AssertEquals ¶
AssertEquals varifies that the two values are equal
func AssertError ¶
AssertError varifies that the err is not nil
func AssertNoError ¶
AssertNoError varifies that the err is nil
func AssertNotEquals ¶
AssertNotEquals varifies that the two values are not equal
func AssertNotNil ¶
AssertNotNil varifies that the value is not nil
func AssertPanic ¶
AssertPanic varifies that a panic is raised during a test
func AssertSame ¶
AssertSame varifies that the two values are same
func ComputeCryptoHash ¶
ComputeCryptoHash computes crypto hash for testing
func ConstructBlock ¶
ConstructBlock constructs a single block with blockNum=1
func ConstructRandomBytes ¶
ConstructRandomBytes constructs random bytes of given size
func ConstructTestBlock ¶
ConstructTestBlock constructs a single block with blocknum=1
func ConstructTestBlocks ¶
ConstructTestBlocks returns a series of blocks starting with blockNum=1
func ConstructTransaction ¶
func ConstructTransaction(t *testing.T, simulationResults []byte, sign bool) (*common.Envelope, string, error)
ConstructTransaction constructs a transaction for testing
func Contains ¶
func Contains(slice interface{}, value interface{}) bool
Contains returns true iff the `value` is present in the `slice`
func ResetConfigToDefaultValues ¶
func ResetConfigToDefaultValues()
ResetConfigToDefaultValues resets configurations optins back to defaults
func SetLogLevel ¶
func SetLogLevel(level logging.Level, module string)
SetLogLevel sets up log level
func SetupCoreYAMLConfig ¶
func SetupCoreYAMLConfig(coreYamlPath string)
SetupCoreYAMLConfig sets up configurations for testing
Types ¶
type BlockGenerator ¶
type BlockGenerator struct {
// contains filtered or unexported fields
}
BlockGenerator generates a series of blocks for testing
func NewBlockGenerator ¶
func NewBlockGenerator(t *testing.T) *BlockGenerator
NewBlockGenerator instantiates new BlockGenerator for testing
func (*BlockGenerator) NextBlock ¶
func (bg *BlockGenerator) NextBlock(simulationResults [][]byte, sign bool) *common.Block
NextBlock constructs next block in sequence that includes a number of transactions - one per simulationResults
func (*BlockGenerator) NextTestBlock ¶
func (bg *BlockGenerator) NextTestBlock(numTx int, txSize int) *common.Block
NextTestBlock constructs next block in sequence block with 'numTx' number of transactions for testing
func (*BlockGenerator) NextTestBlocks ¶
func (bg *BlockGenerator) NextTestBlocks(numBlocks int) []*common.Block
NextTestBlocks constructs 'numBlocks' number of blocks for testing
type TestRandomNumberGenerator ¶
type TestRandomNumberGenerator struct {
// contains filtered or unexported fields
}
TestRandomNumberGenerator a random number generator for testing
func NewTestRandomNumberGenerator ¶
func NewTestRandomNumberGenerator(maxNumber int) *TestRandomNumberGenerator
NewTestRandomNumberGenerator constructs a new `TestRandomNumberGenerator`
func (*TestRandomNumberGenerator) Next ¶
func (randNumGenerator *TestRandomNumberGenerator) Next() int
Next generates next random number