mocks

package
v0.0.8 Latest Latest
Warning

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

Go to latest
Published: Oct 8, 2021 License: ISC Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ProofsWriterMock

type ProofsWriterMock struct {
	// ProofCreateFunc mocks the ProofCreate method.
	ProofCreateFunc func(ctx context.Context, req payd.ProofWrapper) error
	// contains filtered or unexported fields
}

ProofsWriterMock is a mock implementation of payd.ProofsWriter.

func TestSomethingThatUsesProofsWriter(t *testing.T) {

	// make and configure a mocked payd.ProofsWriter
	mockedProofsWriter := &ProofsWriterMock{
		ProofCreateFunc: func(ctx context.Context, req payd.ProofWrapper) error {
			panic("mock out the ProofCreate method")
		},
	}

	// use mockedProofsWriter in code that requires payd.ProofsWriter
	// and then make assertions.

}

func (*ProofsWriterMock) ProofCreate

func (mock *ProofsWriterMock) ProofCreate(ctx context.Context, req payd.ProofWrapper) error

ProofCreate calls ProofCreateFunc.

func (*ProofsWriterMock) ProofCreateCalls

func (mock *ProofsWriterMock) ProofCreateCalls() []struct {
	Ctx context.Context
	Req payd.ProofWrapper
}

ProofCreateCalls gets all the calls that were made to ProofCreate. Check the length with:

len(mockedProofsWriter.ProofCreateCalls())

Jump to

Keyboard shortcuts

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