test

package
v0.12.0 Latest Latest
Warning

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

Go to latest
Published: May 19, 2023 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Overview

Package test contains helper functions for unit testing.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BeBase64

func BeBase64() types.GomegaMatcher

BeBase64 match string if it is Base64 Standard encoded.

func EqualAnyProto

func EqualAnyProto(expected protoreflect.ProtoMessage) types.GomegaMatcher

EqualAnyProto uses proto.Equal to compare actual with expected. Equal is strict about types when performing comparisons. It is an error for both actual and expected to be nil. Use BeNil() instead.

func EqualProto

func EqualProto(expected protoreflect.ProtoMessage) types.GomegaMatcher

EqualProto uses proto.Equal to compare actual with expected. Equal is strict about types when performing comparisons. It is an error for both actual and expected to be nil. Use BeNil() instead.

func MatchErrorCode

func MatchErrorCode(errorCode codes.Code) types.GomegaMatcher

MatchErrorCode succeeds if actual is a non-nil error that has the code the passed in error.

Error must be google.golang.org/grpc/status.Error It is an error for err to be nil or an object that does not implement the Error interface.

func MatchJSON

func MatchJSON(expected interface{}) types.GomegaMatcher

MatchJSON uses the expected value to build a value matcher.

func MatchProtoMessage

func MatchProtoMessage(message proto.Message) types.GomegaMatcher

MatchProtoMessage succeeds if.

func MatchStatusError

func MatchStatusError(errorCode codes.Code, msg interface{}) types.GomegaMatcher

MatchStatusError succeeds if actual is a non-nil error that has the code the passed in error.

Error must be google.golang.org/grpc/status.Error It is an error for err to be nil or an object that does not implement the Error interface.

Types

type EqualAnyProtoMatcher

type EqualAnyProtoMatcher struct {
	Expected proto.Message
	// contains filtered or unexported fields
}

func (*EqualAnyProtoMatcher) FailureMessage

func (matcher *EqualAnyProtoMatcher) FailureMessage(interface{}) (message string)

func (*EqualAnyProtoMatcher) Match

func (matcher *EqualAnyProtoMatcher) Match(actual interface{}) (success bool, err error)

func (*EqualAnyProtoMatcher) NegatedFailureMessage

func (matcher *EqualAnyProtoMatcher) NegatedFailureMessage(interface{}) (message string)

type EqualProtoMatcher

type EqualProtoMatcher struct {
	Expected proto.Message
}

func (*EqualProtoMatcher) FailureMessage

func (matcher *EqualProtoMatcher) FailureMessage(actual interface{}) (message string)

func (*EqualProtoMatcher) GomegaString

func (matcher *EqualProtoMatcher) GomegaString() string

func (*EqualProtoMatcher) Match

func (matcher *EqualProtoMatcher) Match(actual interface{}) (success bool, err error)

func (*EqualProtoMatcher) NegatedFailureMessage

func (matcher *EqualProtoMatcher) NegatedFailureMessage(actual interface{}) (message string)

type MatchJSONMatcher

type MatchJSONMatcher struct {
	types.GomegaMatcher
}

func (*MatchJSONMatcher) Match

func (matcher *MatchJSONMatcher) Match(actual interface{}) (success bool, err error)

type MatchProtoMessageMatcher

type MatchProtoMessageMatcher struct {
	Expected proto.Message
}

func (*MatchProtoMessageMatcher) FailureMessage

func (matcher *MatchProtoMessageMatcher) FailureMessage(actual interface{}) (message string)

func (*MatchProtoMessageMatcher) Match

func (matcher *MatchProtoMessageMatcher) Match(actual interface{}) (success bool, err error)

func (*MatchProtoMessageMatcher) NegatedFailureMessage

func (matcher *MatchProtoMessageMatcher) NegatedFailureMessage(actual interface{}) (message string)

type MatchSDKStatusErrorMatcher

type MatchSDKStatusErrorMatcher struct {
	Expected codes.Code
	// contains filtered or unexported fields
}

func (*MatchSDKStatusErrorMatcher) FailureMessage

func (matcher *MatchSDKStatusErrorMatcher) FailureMessage(actual interface{}) (message string)

func (*MatchSDKStatusErrorMatcher) Match

func (matcher *MatchSDKStatusErrorMatcher) Match(actual interface{}) (success bool, err error)

func (*MatchSDKStatusErrorMatcher) NegatedFailureMessage

func (matcher *MatchSDKStatusErrorMatcher) NegatedFailureMessage(actual interface{}) (message string)

Directories

Path Synopsis
authorization
v1beta1
Package authorization is a generated GoMock package.
Package authorization is a generated GoMock package.
config
v1beta1
Package config is a generated GoMock package.
Package config is a generated GoMock package.
identity
v1beta2
Package identity is a generated GoMock package.
Package identity is a generated GoMock package.
ingest
v1beta1
Package ingest is a generated GoMock package.
Package ingest is a generated GoMock package.
v1beta2
Package ingest is a generated GoMock package.
Package ingest is a generated GoMock package.

Jump to

Keyboard shortcuts

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