Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ReadWriterMock ¶
type ReadWriterMock struct { // ReadAllFunc mocks the ReadAll method. ReadAllFunc func() ([]byte, error) // WriteAllFunc mocks the WriteAll method. WriteAllFunc func(bytes []byte) error // contains filtered or unexported fields }
ReadWriterMock is a mock implementation of vald.ReadWriter.
func TestSomethingThatUsesReadWriter(t *testing.T) { // make and configure a mocked vald.ReadWriter mockedReadWriter := &ReadWriterMock{ ReadAllFunc: func() ([]byte, error) { panic("mock out the ReadAll method") }, WriteAllFunc: func(bytes []byte) error { panic("mock out the WriteAll method") }, } // use mockedReadWriter in code that requires vald.ReadWriter // and then make assertions. }
func (*ReadWriterMock) ReadAll ¶
func (mock *ReadWriterMock) ReadAll() ([]byte, error)
ReadAll calls ReadAllFunc.
func (*ReadWriterMock) ReadAllCalls ¶
func (mock *ReadWriterMock) ReadAllCalls() []struct { }
ReadAllCalls gets all the calls that were made to ReadAll. Check the length with:
len(mockedReadWriter.ReadAllCalls())
func (*ReadWriterMock) WriteAll ¶
func (mock *ReadWriterMock) WriteAll(bytes []byte) error
WriteAll calls WriteAllFunc.
func (*ReadWriterMock) WriteAllCalls ¶
func (mock *ReadWriterMock) WriteAllCalls() []struct { Bytes []byte }
WriteAllCalls gets all the calls that were made to WriteAll. Check the length with:
len(mockedReadWriter.WriteAllCalls())
Click to show internal directories.
Click to hide internal directories.