Adds go mock and generate make target and CI check
This commit is contained in:
parent
3b09a7da10
commit
977e2d993e
7 changed files with 86 additions and 0 deletions
|
@ -1,3 +1,4 @@
|
|||
//go:generate mockgen -source=service.go -destination=service_mock.go -package=notification
|
||||
package notification
|
||||
|
||||
import (
|
||||
|
|
49
notification/service_mock.go
Normal file
49
notification/service_mock.go
Normal file
|
@ -0,0 +1,49 @@
|
|||
// Code generated by MockGen. DO NOT EDIT.
|
||||
// Source: service.go
|
||||
|
||||
// Package notification is a generated GoMock package.
|
||||
package notification
|
||||
|
||||
import (
|
||||
reflect "reflect"
|
||||
|
||||
model "git.ctrlz.es/mgdelacroix/birthdaybot/model"
|
||||
gomock "github.com/golang/mock/gomock"
|
||||
)
|
||||
|
||||
// MockNotificationService is a mock of NotificationService interface.
|
||||
type MockNotificationService struct {
|
||||
ctrl *gomock.Controller
|
||||
recorder *MockNotificationServiceMockRecorder
|
||||
}
|
||||
|
||||
// MockNotificationServiceMockRecorder is the mock recorder for MockNotificationService.
|
||||
type MockNotificationServiceMockRecorder struct {
|
||||
mock *MockNotificationService
|
||||
}
|
||||
|
||||
// NewMockNotificationService creates a new mock instance.
|
||||
func NewMockNotificationService(ctrl *gomock.Controller) *MockNotificationService {
|
||||
mock := &MockNotificationService{ctrl: ctrl}
|
||||
mock.recorder = &MockNotificationServiceMockRecorder{mock}
|
||||
return mock
|
||||
}
|
||||
|
||||
// EXPECT returns an object that allows the caller to indicate expected use.
|
||||
func (m *MockNotificationService) EXPECT() *MockNotificationServiceMockRecorder {
|
||||
return m.recorder
|
||||
}
|
||||
|
||||
// Notify mocks base method.
|
||||
func (m *MockNotificationService) Notify(arg0 *model.Birthday) error {
|
||||
m.ctrl.T.Helper()
|
||||
ret := m.ctrl.Call(m, "Notify", arg0)
|
||||
ret0, _ := ret[0].(error)
|
||||
return ret0
|
||||
}
|
||||
|
||||
// Notify indicates an expected call of Notify.
|
||||
func (mr *MockNotificationServiceMockRecorder) Notify(arg0 interface{}) *gomock.Call {
|
||||
mr.mock.ctrl.T.Helper()
|
||||
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Notify", reflect.TypeOf((*MockNotificationService)(nil).Notify), arg0)
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue