expect

package
v0.7.6 Latest Latest
Warning

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

Go to latest
Published: Jul 20, 2021 License: MIT Imports: 7 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EventIs added in v0.6.1

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

EventIs expects ChaincodeEvent name is equal to expectName and event payload can be marshaled to expectPayload

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 EventStringerEqual added in v0.7.2

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

EventStringerEqual expects ChaincodeEvent name is equal to expectName and event payload String() equal expectPayload String()

func PayloadBytes added in v0.3.0

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, errMatcher ...interface{}) peer.Response

ResponseError expects peer.Response has shim.ERROR status and message has errMatcher matcher

func ResponseOk

func ResponseOk(response peer.Response, okMatcher ...interface{}) peer.Response

ResponseOk expects peer.Response has shim.OK status and message has okMatcher matcher

Types

type Stringer added in v0.6.1

type Stringer interface {
	String() string
}

type TxRes added in v0.6.7

type TxRes struct {
	Result interface{}
	Err    error
	Event  *peer.ChaincodeEvent
}

func (*TxRes) HasError added in v0.6.7

func (r *TxRes) HasError(err interface{}) *TxRes

func (*TxRes) HasNoError added in v0.6.10

func (r *TxRes) HasNoError() *TxRes

func (*TxRes) Is added in v0.6.7

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

func (*TxRes) ProduceEvent added in v0.6.7

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

ProduceEvent expects that tx produces event with particular payload

Jump to

Keyboard shortcuts

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