aides-repo-api/internal/controllers/taskcontroller/controller_test.go

28 lines
673 B
Go
Raw Normal View History

2024-12-26 18:16:05 +00:00
package taskcontroller_test
import (
"errors"
"code.aides.space/aides-infra/aides-repo-api/internal/models"
"code.aides.space/aides-infra/aides-repo-api/internal/services/taskservice"
2024-12-26 18:16:05 +00:00
)
type TaskServiceMock struct {
CreateFunc func(string) (*models.Task, error)
UploadFunc func(*taskservice.TaskUploadInput) error
}
func (s *TaskServiceMock) Create(repo string) (*models.Task, error) {
if s.CreateFunc != nil {
return s.CreateFunc(repo)
}
return nil, errors.New("not implemented")
}
func (s *TaskServiceMock) Upload(input *taskservice.TaskUploadInput) error {
if s.UploadFunc != nil {
return s.UploadFunc(input)
}
return errors.New("not implemented")
}