github.com/apernet/quic-go@v0.43.1-0.20240515053213-5e9e635fd9f0/mock_crypto_stream_test.go (about)

     1  // Code generated by MockGen. DO NOT EDIT.
     2  // Source: github.com/apernet/quic-go (interfaces: CryptoStream)
     3  //
     4  // Generated by this command:
     5  //
     6  //	mockgen -typed -build_flags=-tags=gomock -package quic -self_package github.com/apernet/quic-go -destination mock_crypto_stream_test.go github.com/apernet/quic-go CryptoStream
     7  //
     8  
     9  // Package quic is a generated GoMock package.
    10  package quic
    11  
    12  import (
    13  	reflect "reflect"
    14  
    15  	protocol "github.com/apernet/quic-go/internal/protocol"
    16  	wire "github.com/apernet/quic-go/internal/wire"
    17  	gomock "go.uber.org/mock/gomock"
    18  )
    19  
    20  // MockCryptoStream is a mock of CryptoStream interface.
    21  type MockCryptoStream struct {
    22  	ctrl     *gomock.Controller
    23  	recorder *MockCryptoStreamMockRecorder
    24  }
    25  
    26  // MockCryptoStreamMockRecorder is the mock recorder for MockCryptoStream.
    27  type MockCryptoStreamMockRecorder struct {
    28  	mock *MockCryptoStream
    29  }
    30  
    31  // NewMockCryptoStream creates a new mock instance.
    32  func NewMockCryptoStream(ctrl *gomock.Controller) *MockCryptoStream {
    33  	mock := &MockCryptoStream{ctrl: ctrl}
    34  	mock.recorder = &MockCryptoStreamMockRecorder{mock}
    35  	return mock
    36  }
    37  
    38  // EXPECT returns an object that allows the caller to indicate expected use.
    39  func (m *MockCryptoStream) EXPECT() *MockCryptoStreamMockRecorder {
    40  	return m.recorder
    41  }
    42  
    43  // Finish mocks base method.
    44  func (m *MockCryptoStream) Finish() error {
    45  	m.ctrl.T.Helper()
    46  	ret := m.ctrl.Call(m, "Finish")
    47  	ret0, _ := ret[0].(error)
    48  	return ret0
    49  }
    50  
    51  // Finish indicates an expected call of Finish.
    52  func (mr *MockCryptoStreamMockRecorder) Finish() *MockCryptoStreamFinishCall {
    53  	mr.mock.ctrl.T.Helper()
    54  	call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Finish", reflect.TypeOf((*MockCryptoStream)(nil).Finish))
    55  	return &MockCryptoStreamFinishCall{Call: call}
    56  }
    57  
    58  // MockCryptoStreamFinishCall wrap *gomock.Call
    59  type MockCryptoStreamFinishCall struct {
    60  	*gomock.Call
    61  }
    62  
    63  // Return rewrite *gomock.Call.Return
    64  func (c *MockCryptoStreamFinishCall) Return(arg0 error) *MockCryptoStreamFinishCall {
    65  	c.Call = c.Call.Return(arg0)
    66  	return c
    67  }
    68  
    69  // Do rewrite *gomock.Call.Do
    70  func (c *MockCryptoStreamFinishCall) Do(f func() error) *MockCryptoStreamFinishCall {
    71  	c.Call = c.Call.Do(f)
    72  	return c
    73  }
    74  
    75  // DoAndReturn rewrite *gomock.Call.DoAndReturn
    76  func (c *MockCryptoStreamFinishCall) DoAndReturn(f func() error) *MockCryptoStreamFinishCall {
    77  	c.Call = c.Call.DoAndReturn(f)
    78  	return c
    79  }
    80  
    81  // GetCryptoData mocks base method.
    82  func (m *MockCryptoStream) GetCryptoData() []byte {
    83  	m.ctrl.T.Helper()
    84  	ret := m.ctrl.Call(m, "GetCryptoData")
    85  	ret0, _ := ret[0].([]byte)
    86  	return ret0
    87  }
    88  
    89  // GetCryptoData indicates an expected call of GetCryptoData.
    90  func (mr *MockCryptoStreamMockRecorder) GetCryptoData() *MockCryptoStreamGetCryptoDataCall {
    91  	mr.mock.ctrl.T.Helper()
    92  	call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetCryptoData", reflect.TypeOf((*MockCryptoStream)(nil).GetCryptoData))
    93  	return &MockCryptoStreamGetCryptoDataCall{Call: call}
    94  }
    95  
    96  // MockCryptoStreamGetCryptoDataCall wrap *gomock.Call
    97  type MockCryptoStreamGetCryptoDataCall struct {
    98  	*gomock.Call
    99  }
   100  
   101  // Return rewrite *gomock.Call.Return
   102  func (c *MockCryptoStreamGetCryptoDataCall) Return(arg0 []byte) *MockCryptoStreamGetCryptoDataCall {
   103  	c.Call = c.Call.Return(arg0)
   104  	return c
   105  }
   106  
   107  // Do rewrite *gomock.Call.Do
   108  func (c *MockCryptoStreamGetCryptoDataCall) Do(f func() []byte) *MockCryptoStreamGetCryptoDataCall {
   109  	c.Call = c.Call.Do(f)
   110  	return c
   111  }
   112  
   113  // DoAndReturn rewrite *gomock.Call.DoAndReturn
   114  func (c *MockCryptoStreamGetCryptoDataCall) DoAndReturn(f func() []byte) *MockCryptoStreamGetCryptoDataCall {
   115  	c.Call = c.Call.DoAndReturn(f)
   116  	return c
   117  }
   118  
   119  // HandleCryptoFrame mocks base method.
   120  func (m *MockCryptoStream) HandleCryptoFrame(arg0 *wire.CryptoFrame) error {
   121  	m.ctrl.T.Helper()
   122  	ret := m.ctrl.Call(m, "HandleCryptoFrame", arg0)
   123  	ret0, _ := ret[0].(error)
   124  	return ret0
   125  }
   126  
   127  // HandleCryptoFrame indicates an expected call of HandleCryptoFrame.
   128  func (mr *MockCryptoStreamMockRecorder) HandleCryptoFrame(arg0 any) *MockCryptoStreamHandleCryptoFrameCall {
   129  	mr.mock.ctrl.T.Helper()
   130  	call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "HandleCryptoFrame", reflect.TypeOf((*MockCryptoStream)(nil).HandleCryptoFrame), arg0)
   131  	return &MockCryptoStreamHandleCryptoFrameCall{Call: call}
   132  }
   133  
   134  // MockCryptoStreamHandleCryptoFrameCall wrap *gomock.Call
   135  type MockCryptoStreamHandleCryptoFrameCall struct {
   136  	*gomock.Call
   137  }
   138  
   139  // Return rewrite *gomock.Call.Return
   140  func (c *MockCryptoStreamHandleCryptoFrameCall) Return(arg0 error) *MockCryptoStreamHandleCryptoFrameCall {
   141  	c.Call = c.Call.Return(arg0)
   142  	return c
   143  }
   144  
   145  // Do rewrite *gomock.Call.Do
   146  func (c *MockCryptoStreamHandleCryptoFrameCall) Do(f func(*wire.CryptoFrame) error) *MockCryptoStreamHandleCryptoFrameCall {
   147  	c.Call = c.Call.Do(f)
   148  	return c
   149  }
   150  
   151  // DoAndReturn rewrite *gomock.Call.DoAndReturn
   152  func (c *MockCryptoStreamHandleCryptoFrameCall) DoAndReturn(f func(*wire.CryptoFrame) error) *MockCryptoStreamHandleCryptoFrameCall {
   153  	c.Call = c.Call.DoAndReturn(f)
   154  	return c
   155  }
   156  
   157  // HasData mocks base method.
   158  func (m *MockCryptoStream) HasData() bool {
   159  	m.ctrl.T.Helper()
   160  	ret := m.ctrl.Call(m, "HasData")
   161  	ret0, _ := ret[0].(bool)
   162  	return ret0
   163  }
   164  
   165  // HasData indicates an expected call of HasData.
   166  func (mr *MockCryptoStreamMockRecorder) HasData() *MockCryptoStreamHasDataCall {
   167  	mr.mock.ctrl.T.Helper()
   168  	call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "HasData", reflect.TypeOf((*MockCryptoStream)(nil).HasData))
   169  	return &MockCryptoStreamHasDataCall{Call: call}
   170  }
   171  
   172  // MockCryptoStreamHasDataCall wrap *gomock.Call
   173  type MockCryptoStreamHasDataCall struct {
   174  	*gomock.Call
   175  }
   176  
   177  // Return rewrite *gomock.Call.Return
   178  func (c *MockCryptoStreamHasDataCall) Return(arg0 bool) *MockCryptoStreamHasDataCall {
   179  	c.Call = c.Call.Return(arg0)
   180  	return c
   181  }
   182  
   183  // Do rewrite *gomock.Call.Do
   184  func (c *MockCryptoStreamHasDataCall) Do(f func() bool) *MockCryptoStreamHasDataCall {
   185  	c.Call = c.Call.Do(f)
   186  	return c
   187  }
   188  
   189  // DoAndReturn rewrite *gomock.Call.DoAndReturn
   190  func (c *MockCryptoStreamHasDataCall) DoAndReturn(f func() bool) *MockCryptoStreamHasDataCall {
   191  	c.Call = c.Call.DoAndReturn(f)
   192  	return c
   193  }
   194  
   195  // PopCryptoFrame mocks base method.
   196  func (m *MockCryptoStream) PopCryptoFrame(arg0 protocol.ByteCount) *wire.CryptoFrame {
   197  	m.ctrl.T.Helper()
   198  	ret := m.ctrl.Call(m, "PopCryptoFrame", arg0)
   199  	ret0, _ := ret[0].(*wire.CryptoFrame)
   200  	return ret0
   201  }
   202  
   203  // PopCryptoFrame indicates an expected call of PopCryptoFrame.
   204  func (mr *MockCryptoStreamMockRecorder) PopCryptoFrame(arg0 any) *MockCryptoStreamPopCryptoFrameCall {
   205  	mr.mock.ctrl.T.Helper()
   206  	call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "PopCryptoFrame", reflect.TypeOf((*MockCryptoStream)(nil).PopCryptoFrame), arg0)
   207  	return &MockCryptoStreamPopCryptoFrameCall{Call: call}
   208  }
   209  
   210  // MockCryptoStreamPopCryptoFrameCall wrap *gomock.Call
   211  type MockCryptoStreamPopCryptoFrameCall struct {
   212  	*gomock.Call
   213  }
   214  
   215  // Return rewrite *gomock.Call.Return
   216  func (c *MockCryptoStreamPopCryptoFrameCall) Return(arg0 *wire.CryptoFrame) *MockCryptoStreamPopCryptoFrameCall {
   217  	c.Call = c.Call.Return(arg0)
   218  	return c
   219  }
   220  
   221  // Do rewrite *gomock.Call.Do
   222  func (c *MockCryptoStreamPopCryptoFrameCall) Do(f func(protocol.ByteCount) *wire.CryptoFrame) *MockCryptoStreamPopCryptoFrameCall {
   223  	c.Call = c.Call.Do(f)
   224  	return c
   225  }
   226  
   227  // DoAndReturn rewrite *gomock.Call.DoAndReturn
   228  func (c *MockCryptoStreamPopCryptoFrameCall) DoAndReturn(f func(protocol.ByteCount) *wire.CryptoFrame) *MockCryptoStreamPopCryptoFrameCall {
   229  	c.Call = c.Call.DoAndReturn(f)
   230  	return c
   231  }
   232  
   233  // Write mocks base method.
   234  func (m *MockCryptoStream) Write(arg0 []byte) (int, error) {
   235  	m.ctrl.T.Helper()
   236  	ret := m.ctrl.Call(m, "Write", arg0)
   237  	ret0, _ := ret[0].(int)
   238  	ret1, _ := ret[1].(error)
   239  	return ret0, ret1
   240  }
   241  
   242  // Write indicates an expected call of Write.
   243  func (mr *MockCryptoStreamMockRecorder) Write(arg0 any) *MockCryptoStreamWriteCall {
   244  	mr.mock.ctrl.T.Helper()
   245  	call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Write", reflect.TypeOf((*MockCryptoStream)(nil).Write), arg0)
   246  	return &MockCryptoStreamWriteCall{Call: call}
   247  }
   248  
   249  // MockCryptoStreamWriteCall wrap *gomock.Call
   250  type MockCryptoStreamWriteCall struct {
   251  	*gomock.Call
   252  }
   253  
   254  // Return rewrite *gomock.Call.Return
   255  func (c *MockCryptoStreamWriteCall) Return(arg0 int, arg1 error) *MockCryptoStreamWriteCall {
   256  	c.Call = c.Call.Return(arg0, arg1)
   257  	return c
   258  }
   259  
   260  // Do rewrite *gomock.Call.Do
   261  func (c *MockCryptoStreamWriteCall) Do(f func([]byte) (int, error)) *MockCryptoStreamWriteCall {
   262  	c.Call = c.Call.Do(f)
   263  	return c
   264  }
   265  
   266  // DoAndReturn rewrite *gomock.Call.DoAndReturn
   267  func (c *MockCryptoStreamWriteCall) DoAndReturn(f func([]byte) (int, error)) *MockCryptoStreamWriteCall {
   268  	c.Call = c.Call.DoAndReturn(f)
   269  	return c
   270  }