This commit is contained in:
2025-09-03 08:29:15 -07:00
parent 56f55daa85
commit 2898ccdb79
164 changed files with 275 additions and 25235 deletions

View File

@@ -50,6 +50,53 @@ func TestWorkoutService_List(t *testing.T) {
},
wantErr: false,
},
{
name: "successful list with pagination",
mockResponse: []Workout{
{ID: "2", Name: "Evening Ride", Type: "cycling"},
},
mockStatusCode: http.StatusOK,
opts: WorkoutListOptions{
Limit: 1,
Offset: 1,
},
wantErr: false,
},
{
name: "successful list with sorting",
mockResponse: []Workout{
{ID: "1", Name: "Morning Run", Type: "running"},
{ID: "2", Name: "Evening Ride", Type: "cycling"},
},
mockStatusCode: http.StatusOK,
opts: WorkoutListOptions{
SortBy: "createdDate",
SortOrder: "desc",
},
wantErr: false,
},
{
name: "successful list with type filter",
mockResponse: []Workout{
{ID: "1", Name: "Morning Run", Type: "running"},
},
mockStatusCode: http.StatusOK,
opts: WorkoutListOptions{
Type: "running",
},
wantErr: false,
},
{
name: "successful list with status filter",
mockResponse: []Workout{
{ID: "1", Name: "Morning Run", Type: "running"},
},
mockStatusCode: http.StatusOK,
opts: WorkoutListOptions{
Status: "active",
},
wantErr: false,
},
{
name: "server error",
mockResponse: nil,