style: reformatted all files

This commit is contained in:
ITQ
2025-12-19 21:04:12 +03:00
parent d7320f2198
commit 5c89ca5f09
21 changed files with 288 additions and 107 deletions
+24 -24
View File
@@ -7,8 +7,8 @@ import (
"datarush/internal/task/service/mocks"
pb "datarush/pkg/api/task"
"go.uber.org/mock/gomock"
"github.com/stretchr/testify/assert"
"go.uber.org/mock/gomock"
"google.golang.org/protobuf/types/known/timestamppb"
)
@@ -24,13 +24,13 @@ func TestTaskService(t *testing.T) {
t.Run("CreateTask", func(t *testing.T) {
task := &pb.Task{
CompetitionId: "comp1",
Title: "Test Task",
Description: "This is a test task",
CompetitionId: "comp1",
Title: "Test Task",
Description: "This is a test task",
InCompetitionPosition: 1,
MaxPoints: 100,
MaxAttempts: 10,
Type: pb.TaskType_TASK_TYPE_INPUT,
MaxPoints: 100,
MaxAttempts: 10,
Type: pb.TaskType_TASK_TYPE_INPUT,
}
mockRepo.EXPECT().CreateTask(ctx, task).Return(task, nil)
@@ -44,16 +44,16 @@ func TestTaskService(t *testing.T) {
taskID := "task1"
req := &pb.GetTaskRequest{TaskId: taskID}
expectedTask := &pb.Task{
Id: taskID,
CompetitionId: "comp1",
Title: "Test Task",
Description: "This is a test task",
Id: taskID,
CompetitionId: "comp1",
Title: "Test Task",
Description: "This is a test task",
InCompetitionPosition: 1,
MaxPoints: 100,
MaxAttempts: 10,
Type: pb.TaskType_TASK_TYPE_INPUT,
CreatedAt: timestamppb.Now(),
UpdatedAt: timestamppb.Now(),
MaxPoints: 100,
MaxAttempts: 10,
Type: pb.TaskType_TASK_TYPE_INPUT,
CreatedAt: timestamppb.Now(),
UpdatedAt: timestamppb.Now(),
}
mockRepo.EXPECT().GetTask(ctx, taskID).Return(expectedTask, nil)
@@ -65,14 +65,14 @@ func TestTaskService(t *testing.T) {
t.Run("EditTask", func(t *testing.T) {
task := &pb.Task{
Id: "task1",
CompetitionId: "comp1",
Title: "Updated Test Task",
Description: "This is an updated test task",
Id: "task1",
CompetitionId: "comp1",
Title: "Updated Test Task",
Description: "This is an updated test task",
InCompetitionPosition: 1,
MaxPoints: 150,
MaxAttempts: 5,
Type: pb.TaskType_TASK_TYPE_CHECKER,
MaxPoints: 150,
MaxAttempts: 5,
Type: pb.TaskType_TASK_TYPE_CHECKER,
}
mockRepo.EXPECT().EditTask(ctx, task).Return(task, nil)
@@ -137,4 +137,4 @@ func TestTaskService(t *testing.T) {
assert.NoError(t, err)
assert.Equal(t, expectedAttachments, resp.Attachments)
})
}
}