github.com/koko1123/flow-go-1@v0.29.6/network/mocknetwork/ping_service.go (about)

     1  // Code generated by mockery v2.13.1. DO NOT EDIT.
     2  
     3  package mocknetwork
     4  
     5  import (
     6  	context "context"
     7  
     8  	message "github.com/koko1123/flow-go-1/network/message"
     9  	mock "github.com/stretchr/testify/mock"
    10  
    11  	peer "github.com/libp2p/go-libp2p/core/peer"
    12  
    13  	time "time"
    14  )
    15  
    16  // PingService is an autogenerated mock type for the PingService type
    17  type PingService struct {
    18  	mock.Mock
    19  }
    20  
    21  // Ping provides a mock function with given fields: ctx, peerID
    22  func (_m *PingService) Ping(ctx context.Context, peerID peer.ID) (message.PingResponse, time.Duration, error) {
    23  	ret := _m.Called(ctx, peerID)
    24  
    25  	var r0 message.PingResponse
    26  	if rf, ok := ret.Get(0).(func(context.Context, peer.ID) message.PingResponse); ok {
    27  		r0 = rf(ctx, peerID)
    28  	} else {
    29  		r0 = ret.Get(0).(message.PingResponse)
    30  	}
    31  
    32  	var r1 time.Duration
    33  	if rf, ok := ret.Get(1).(func(context.Context, peer.ID) time.Duration); ok {
    34  		r1 = rf(ctx, peerID)
    35  	} else {
    36  		r1 = ret.Get(1).(time.Duration)
    37  	}
    38  
    39  	var r2 error
    40  	if rf, ok := ret.Get(2).(func(context.Context, peer.ID) error); ok {
    41  		r2 = rf(ctx, peerID)
    42  	} else {
    43  		r2 = ret.Error(2)
    44  	}
    45  
    46  	return r0, r1, r2
    47  }
    48  
    49  type mockConstructorTestingTNewPingService interface {
    50  	mock.TestingT
    51  	Cleanup(func())
    52  }
    53  
    54  // NewPingService creates a new instance of PingService. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
    55  func NewPingService(t mockConstructorTestingTNewPingService) *PingService {
    56  	mock := &PingService{}
    57  	mock.Mock.Test(t)
    58  
    59  	t.Cleanup(func() { mock.AssertExpectations(t) })
    60  
    61  	return mock
    62  }