expect

package
v0.6.3-kompitech1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 13, 2020 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EventIs

func EventIs(event *peer.ChaincodeEvent, expectName string, expectPayload interface{})

func EventPayloadIs

func EventPayloadIs(event *peer.ChaincodeEvent, target interface{}) interface{}

EventPayloadIs expects peer.ChaincodeEvent payload can be marshaled to target interface{} and returns converted value

func PayloadBytes

func PayloadBytes(response peer.Response, expectedValue []byte) []byte

PayloadBytes expects response is ok and compares response.Payload with expected value

func PayloadInt

func PayloadInt(response peer.Response, expectedValue int) int

func PayloadIs

func PayloadIs(response peer.Response, target interface{}) interface{}

PayloadIs expects peer.Response payload can be marshalled to target interface{} and returns converted value

func PayloadString

func PayloadString(response peer.Response, expectedValue string) string

PayloadString expects payload content is string

func ResponseError

func ResponseError(response peer.Response, errorSubstr ...interface{}) peer.Response

ResponseError expects peer.Response has shim.ERROR status and message has errorSubstr prefix

func ResponseOk

func ResponseOk(response peer.Response, okSubstr ...string) peer.Response

ResponseOk expects peer.Response has shim.OK status and message has okSubstr prefix

Types

type Stringer

type Stringer interface {
	String() string
}

type TxResult

type TxResult struct {
	*testing.TxResult
}

func SvcResponse

func SvcResponse(res *testing.TxResult) *TxResult

func (*TxResult) HasError

func (r *TxResult) HasError(err error) *TxResult

func (*TxResult) Is

func (r *TxResult) Is(expectedResult interface{}) *TxResult

func (*TxResult) ProduceEvent

func (r *TxResult) ProduceEvent(eventName string, eventPayload interface{})

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL