// Code generated by mockery v2.13.0-beta.1. DO NOT EDIT.

package mocks

import (
	network "github.com/libp2p/go-libp2p-core/network"
	mock "github.com/stretchr/testify/mock"

	protocol "github.com/libp2p/go-libp2p-core/protocol"

	time "time"
)

// StreamMock is an autogenerated mock type for the Stream type
type StreamMock struct {
	mock.Mock
}

// Close provides a mock function with given fields:
func (_m *StreamMock) Close() error {
	ret := _m.Called()

	var r0 error
	if rf, ok := ret.Get(0).(func() error); ok {
		r0 = rf()
	} else {
		r0 = ret.Error(0)
	}

	return r0
}

// CloseRead provides a mock function with given fields:
func (_m *StreamMock) CloseRead() error {
	ret := _m.Called()

	var r0 error
	if rf, ok := ret.Get(0).(func() error); ok {
		r0 = rf()
	} else {
		r0 = ret.Error(0)
	}

	return r0
}

// CloseWrite provides a mock function with given fields:
func (_m *StreamMock) CloseWrite() error {
	ret := _m.Called()

	var r0 error
	if rf, ok := ret.Get(0).(func() error); ok {
		r0 = rf()
	} else {
		r0 = ret.Error(0)
	}

	return r0
}

// Conn provides a mock function with given fields:
func (_m *StreamMock) Conn() network.Conn {
	ret := _m.Called()

	var r0 network.Conn
	if rf, ok := ret.Get(0).(func() network.Conn); ok {
		r0 = rf()
	} else {
		if ret.Get(0) != nil {
			r0 = ret.Get(0).(network.Conn)
		}
	}

	return r0
}

// ID provides a mock function with given fields:
func (_m *StreamMock) ID() string {
	ret := _m.Called()

	var r0 string
	if rf, ok := ret.Get(0).(func() string); ok {
		r0 = rf()
	} else {
		r0 = ret.Get(0).(string)
	}

	return r0
}

// Protocol provides a mock function with given fields:
func (_m *StreamMock) Protocol() protocol.ID {
	ret := _m.Called()

	var r0 protocol.ID
	if rf, ok := ret.Get(0).(func() protocol.ID); ok {
		r0 = rf()
	} else {
		r0 = ret.Get(0).(protocol.ID)
	}

	return r0
}

// Read provides a mock function with given fields: p
func (_m *StreamMock) Read(p []byte) (int, error) {
	ret := _m.Called(p)

	var r0 int
	if rf, ok := ret.Get(0).(func([]byte) int); ok {
		r0 = rf(p)
	} else {
		r0 = ret.Get(0).(int)
	}

	var r1 error
	if rf, ok := ret.Get(1).(func([]byte) error); ok {
		r1 = rf(p)
	} else {
		r1 = ret.Error(1)
	}

	return r0, r1
}

// Reset provides a mock function with given fields:
func (_m *StreamMock) Reset() error {
	ret := _m.Called()

	var r0 error
	if rf, ok := ret.Get(0).(func() error); ok {
		r0 = rf()
	} else {
		r0 = ret.Error(0)
	}

	return r0
}

// Scope provides a mock function with given fields:
func (_m *StreamMock) Scope() network.StreamScope {
	ret := _m.Called()

	var r0 network.StreamScope
	if rf, ok := ret.Get(0).(func() network.StreamScope); ok {
		r0 = rf()
	} else {
		if ret.Get(0) != nil {
			r0 = ret.Get(0).(network.StreamScope)
		}
	}

	return r0
}

// SetDeadline provides a mock function with given fields: _a0
func (_m *StreamMock) SetDeadline(_a0 time.Time) error {
	ret := _m.Called(_a0)

	var r0 error
	if rf, ok := ret.Get(0).(func(time.Time) error); ok {
		r0 = rf(_a0)
	} else {
		r0 = ret.Error(0)
	}

	return r0
}

// SetProtocol provides a mock function with given fields: id
func (_m *StreamMock) SetProtocol(id protocol.ID) error {
	ret := _m.Called(id)

	var r0 error
	if rf, ok := ret.Get(0).(func(protocol.ID) error); ok {
		r0 = rf(id)
	} else {
		r0 = ret.Error(0)
	}

	return r0
}

// SetReadDeadline provides a mock function with given fields: _a0
func (_m *StreamMock) SetReadDeadline(_a0 time.Time) error {
	ret := _m.Called(_a0)

	var r0 error
	if rf, ok := ret.Get(0).(func(time.Time) error); ok {
		r0 = rf(_a0)
	} else {
		r0 = ret.Error(0)
	}

	return r0
}

// SetWriteDeadline provides a mock function with given fields: _a0
func (_m *StreamMock) SetWriteDeadline(_a0 time.Time) error {
	ret := _m.Called(_a0)

	var r0 error
	if rf, ok := ret.Get(0).(func(time.Time) error); ok {
		r0 = rf(_a0)
	} else {
		r0 = ret.Error(0)
	}

	return r0
}

// Stat provides a mock function with given fields:
func (_m *StreamMock) Stat() network.Stats {
	ret := _m.Called()

	var r0 network.Stats
	if rf, ok := ret.Get(0).(func() network.Stats); ok {
		r0 = rf()
	} else {
		r0 = ret.Get(0).(network.Stats)
	}

	return r0
}

// Write provides a mock function with given fields: p
func (_m *StreamMock) Write(p []byte) (int, error) {
	ret := _m.Called(p)

	var r0 int
	if rf, ok := ret.Get(0).(func([]byte) int); ok {
		r0 = rf(p)
	} else {
		r0 = ret.Get(0).(int)
	}

	var r1 error
	if rf, ok := ret.Get(1).(func([]byte) error); ok {
		r1 = rf(p)
	} else {
		r1 = ret.Error(1)
	}

	return r0, r1
}

type NewStreamMockT interface {
	mock.TestingT
	Cleanup(func())
}

// NewStreamMock creates a new instance of StreamMock. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
func NewStreamMock(t NewStreamMockT) *StreamMock {
	mock := &StreamMock{}
	mock.Mock.Test(t)

	t.Cleanup(func() { mock.AssertExpectations(t) })

	return mock
}
