(t *testing.T)
| 7 | ) |
| 8 | |
| 9 | func TestNewExecutionPlan(t *testing.T) { |
| 10 | description := "Test plan description" |
| 11 | plan := NewExecutionPlan(description) |
| 12 | |
| 13 | if plan == nil { |
| 14 | t.Fatal("NewExecutionPlan returned nil") |
| 15 | } |
| 16 | |
| 17 | if plan.Description != description { |
| 18 | t.Errorf("expected description %q, got %q", description, plan.Description) |
| 19 | } |
| 20 | |
| 21 | if plan.Status != StatusDraft { |
| 22 | t.Errorf("expected status %v, got %v", StatusDraft, plan.Status) |
| 23 | } |
| 24 | |
| 25 | if plan.ID == "" { |
| 26 | t.Error("expected non-empty ID") |
| 27 | } |
| 28 | |
| 29 | if len(plan.Steps) != 0 { |
| 30 | t.Errorf("expected 0 steps, got %d", len(plan.Steps)) |
| 31 | } |
| 32 | |
| 33 | if plan.Options == nil { |
| 34 | t.Error("expected non-nil Options") |
| 35 | } |
| 36 | |
| 37 | if !plan.Options.RequireApproval { |
| 38 | t.Error("expected RequireApproval to be true by default") |
| 39 | } |
| 40 | |
| 41 | if !plan.Options.StopOnError { |
| 42 | t.Error("expected StopOnError to be true by default") |
| 43 | } |
| 44 | } |
| 45 | |
| 46 | func TestAddStep(t *testing.T) { |
| 47 | plan := NewExecutionPlan("Test plan") |
nothing calls this directly
no test coverage detected