(t *testing.T)
| 237 | } |
| 238 | |
| 239 | func TestApprove(t *testing.T) { |
| 240 | plan := NewExecutionPlan("Test plan") |
| 241 | approvedBy := "user@example.com" |
| 242 | |
| 243 | plan.Approve(approvedBy) |
| 244 | |
| 245 | if !plan.UserApproved { |
| 246 | t.Error("expected UserApproved to be true") |
| 247 | } |
| 248 | |
| 249 | if plan.ApprovedBy != approvedBy { |
| 250 | t.Errorf("expected ApprovedBy %q, got %q", approvedBy, plan.ApprovedBy) |
| 251 | } |
| 252 | |
| 253 | if plan.ApprovedAt == nil { |
| 254 | t.Error("expected ApprovedAt to be set") |
| 255 | } |
| 256 | |
| 257 | if plan.Status != StatusApproved { |
| 258 | t.Errorf("expected status %v, got %v", StatusApproved, plan.Status) |
| 259 | } |
| 260 | } |
| 261 | |
| 262 | func TestReject(t *testing.T) { |
| 263 | plan := NewExecutionPlan("Test plan") |
nothing calls this directly
no test coverage detected