diff --git a/mocks/mockery/change_stream.go b/mocks/mockery/change_stream.go index adbe094..4fe4b65 100644 --- a/mocks/mockery/change_stream.go +++ b/mocks/mockery/change_stream.go @@ -131,13 +131,12 @@ func (_m *ChangeStream) TryNext(ctx context.Context) bool { return r0 } -type mockConstructorTestingTNewChangeStream interface { +// NewChangeStream creates a new instance of ChangeStream. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +// The first argument is typically a *testing.T value. +func NewChangeStream(t interface { mock.TestingT Cleanup(func()) -} - -// NewChangeStream creates a new instance of ChangeStream. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. -func NewChangeStream(t mockConstructorTestingTNewChangeStream) *ChangeStream { +}) *ChangeStream { mock := &ChangeStream{} mock.Mock.Test(t) diff --git a/mocks/mockery/client.go b/mocks/mockery/client.go index ea37dd3..cbec7f1 100644 --- a/mocks/mockery/client.go +++ b/mocks/mockery/client.go @@ -274,13 +274,12 @@ func (_m *Client) Watch(ctx context.Context, pipeline interface{}, opts ...*opti return r0, r1 } -type mockConstructorTestingTNewClient interface { +// NewClient creates a new instance of Client. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +// The first argument is typically a *testing.T value. +func NewClient(t interface { mock.TestingT Cleanup(func()) -} - -// NewClient creates a new instance of Client. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. -func NewClient(t mockConstructorTestingTNewClient) *Client { +}) *Client { mock := &Client{} mock.Mock.Test(t) diff --git a/mocks/mockery/collection.go b/mocks/mockery/collection.go index c5d250a..073de95 100644 --- a/mocks/mockery/collection.go +++ b/mocks/mockery/collection.go @@ -693,13 +693,12 @@ func (_m *Collection) Watch(ctx context.Context, pipeline interface{}, opts ...* return r0, r1 } -type mockConstructorTestingTNewCollection interface { +// NewCollection creates a new instance of Collection. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +// The first argument is typically a *testing.T value. +func NewCollection(t interface { mock.TestingT Cleanup(func()) -} - -// NewCollection creates a new instance of Collection. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. -func NewCollection(t mockConstructorTestingTNewCollection) *Collection { +}) *Collection { mock := &Collection{} mock.Mock.Test(t) diff --git a/mocks/mockery/cursor.go b/mocks/mockery/cursor.go index ae9c1b4..d4f5a1b 100644 --- a/mocks/mockery/cursor.go +++ b/mocks/mockery/cursor.go @@ -143,13 +143,12 @@ func (_m *Cursor) TryNext(ctx context.Context) bool { return r0 } -type mockConstructorTestingTNewCursor interface { +// NewCursor creates a new instance of Cursor. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +// The first argument is typically a *testing.T value. +func NewCursor(t interface { mock.TestingT Cleanup(func()) -} - -// NewCursor creates a new instance of Cursor. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. -func NewCursor(t mockConstructorTestingTNewCursor) *Cursor { +}) *Cursor { mock := &Cursor{} mock.Mock.Test(t) diff --git a/mocks/mockery/database.go b/mocks/mockery/database.go index 2f97ff4..2715e4a 100644 --- a/mocks/mockery/database.go +++ b/mocks/mockery/database.go @@ -402,13 +402,12 @@ func (_m *Database) WriteConcern() *writeconcern.WriteConcern { return r0 } -type mockConstructorTestingTNewDatabase interface { +// NewDatabase creates a new instance of Database. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +// The first argument is typically a *testing.T value. +func NewDatabase(t interface { mock.TestingT Cleanup(func()) -} - -// NewDatabase creates a new instance of Database. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. -func NewDatabase(t mockConstructorTestingTNewDatabase) *Database { +}) *Database { mock := &Database{} mock.Mock.Test(t) diff --git a/mocks/mockery/index_view.go b/mocks/mockery/index_view.go index 318f999..feed901 100644 --- a/mocks/mockery/index_view.go +++ b/mocks/mockery/index_view.go @@ -217,13 +217,12 @@ func (_m *IndexView) ListSpecifications(ctx context.Context, opts ...*options.Li return r0, r1 } -type mockConstructorTestingTNewIndexView interface { +// NewIndexView creates a new instance of IndexView. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +// The first argument is typically a *testing.T value. +func NewIndexView(t interface { mock.TestingT Cleanup(func()) -} - -// NewIndexView creates a new instance of IndexView. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. -func NewIndexView(t mockConstructorTestingTNewIndexView) *IndexView { +}) *IndexView { mock := &IndexView{} mock.Mock.Test(t) diff --git a/mocks/mockery/session.go b/mocks/mockery/session.go index 1ce2953..d519ee0 100644 --- a/mocks/mockery/session.go +++ b/mocks/mockery/session.go @@ -199,13 +199,12 @@ func (_m *Session) WithTransaction(ctx context.Context, fn func(mongoifc.Session return r0, r1 } -type mockConstructorTestingTNewSession interface { +// NewSession creates a new instance of Session. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +// The first argument is typically a *testing.T value. +func NewSession(t interface { mock.TestingT Cleanup(func()) -} - -// NewSession creates a new instance of Session. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. -func NewSession(t mockConstructorTestingTNewSession) *Session { +}) *Session { mock := &Session{} mock.Mock.Test(t) diff --git a/mocks/mockery/session_context.go b/mocks/mockery/session_context.go index dae0924..b0064fa 100644 --- a/mocks/mockery/session_context.go +++ b/mocks/mockery/session_context.go @@ -271,13 +271,12 @@ func (_m *SessionContext) WithTransaction(ctx context.Context, fn func(mongoifc. return r0, r1 } -type mockConstructorTestingTNewSessionContext interface { +// NewSessionContext creates a new instance of SessionContext. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +// The first argument is typically a *testing.T value. +func NewSessionContext(t interface { mock.TestingT Cleanup(func()) -} - -// NewSessionContext creates a new instance of SessionContext. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. -func NewSessionContext(t mockConstructorTestingTNewSessionContext) *SessionContext { +}) *SessionContext { mock := &SessionContext{} mock.Mock.Test(t) diff --git a/mocks/mockery/single_result.go b/mocks/mockery/single_result.go index 4e074ff..3b1ea4b 100644 --- a/mocks/mockery/single_result.go +++ b/mocks/mockery/single_result.go @@ -66,13 +66,12 @@ func (_m *SingleResult) Err() error { return r0 } -type mockConstructorTestingTNewSingleResult interface { +// NewSingleResult creates a new instance of SingleResult. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +// The first argument is typically a *testing.T value. +func NewSingleResult(t interface { mock.TestingT Cleanup(func()) -} - -// NewSingleResult creates a new instance of SingleResult. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. -func NewSingleResult(t mockConstructorTestingTNewSingleResult) *SingleResult { +}) *SingleResult { mock := &SingleResult{} mock.Mock.Test(t)