(t *testing.T)
| 195 | } |
| 196 | |
| 197 | func TestValidate_CancelledStatus(t *testing.T) { |
| 198 | tests := []struct { |
| 199 | name string |
| 200 | tasks []*model.Task |
| 201 | wantErrs int |
| 202 | }{ |
| 203 | { |
| 204 | name: "valid cancelled status", |
| 205 | tasks: []*model.Task{ |
| 206 | { |
| 207 | ID: "001", |
| 208 | Title: "Cancelled Task", |
| 209 | Status: model.StatusCancelled, |
| 210 | }, |
| 211 | }, |
| 212 | wantErrs: 0, |
| 213 | }, |
| 214 | { |
| 215 | name: "all valid statuses including cancelled", |
| 216 | tasks: []*model.Task{ |
| 217 | {ID: "001", Title: "Pending", Status: model.StatusPending}, |
| 218 | {ID: "002", Title: "In Progress", Status: model.StatusInProgress}, |
| 219 | {ID: "003", Title: "Completed", Status: model.StatusCompleted}, |
| 220 | {ID: "004", Title: "Blocked", Status: model.StatusBlocked}, |
| 221 | {ID: "005", Title: "Cancelled", Status: model.StatusCancelled}, |
| 222 | }, |
| 223 | wantErrs: 0, |
| 224 | }, |
| 225 | } |
| 226 | |
| 227 | for _, tt := range tests { |
| 228 | t.Run(tt.name, func(t *testing.T) { |
| 229 | v := NewValidator(false) |
| 230 | result := v.Validate(tt.tasks) |
| 231 | |
| 232 | if result.Errors != tt.wantErrs { |
| 233 | t.Errorf("Validate() errors = %d, want %d", result.Errors, tt.wantErrs) |
| 234 | for _, issue := range result.Issues { |
| 235 | t.Logf(" Issue: %s", issue.Message) |
| 236 | } |
| 237 | } |
| 238 | }) |
| 239 | } |
| 240 | } |
| 241 | |
| 242 | func TestValidate_DuplicateIDs(t *testing.T) { |
| 243 | tasks := []*model.Task{ |
nothing calls this directly
no test coverage detected