readertest

package
v1.22.0 Latest Latest
Warning

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

Go to latest
Published: Jan 16, 2023 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type WrappedReaderMock

type WrappedReaderMock struct {
	// ReadFunc mocks the Read method.
	ReadFunc func(p []byte) (int, error)
	// contains filtered or unexported fields
}

WrappedReaderMock is a mock implementation of reader.WrappedReader.

func TestSomethingThatUsesWrappedReader(t *testing.T) {

	// make and configure a mocked reader.WrappedReader
	mockedWrappedReader := &WrappedReaderMock{
		ReadFunc: func(p []byte) (int, error) {
			panic("mock out the Read method")
		},
	}

	// use mockedWrappedReader in code that requires reader.WrappedReader
	// and then make assertions.

}

func (*WrappedReaderMock) Read

func (mock *WrappedReaderMock) Read(p []byte) (int, error)

Read calls ReadFunc.

func (*WrappedReaderMock) ReadCalls

func (mock *WrappedReaderMock) ReadCalls() []struct {
	P []byte
}

ReadCalls gets all the calls that were made to Read. Check the length with:

len(mockedWrappedReader.ReadCalls())

Jump to

Keyboard shortcuts

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