aides-repo-api/internal/controllers/taskcontroller/controller_test.go
Maxim Slipenko e4f9743dea
Some checks failed
Format and Lint / format-check (push) Failing after 2s
Format and Lint / test (push) Successful in 52s
chore: change code.alt-gnome to code.aides.space
2025-01-07 17:54:16 +03:00

27 lines
673 B
Go

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"
)
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")
}