(t *testing.T)
| 178 | } |
| 179 | |
| 180 | func TestIsApproved(t *testing.T) { |
| 181 | tests := []struct { |
| 182 | name string |
| 183 | userApproved bool |
| 184 | autoApprove bool |
| 185 | expected bool |
| 186 | }{ |
| 187 | {"not approved", false, false, false}, |
| 188 | {"user approved", true, false, true}, |
| 189 | {"auto approve", false, true, true}, |
| 190 | {"both approved", true, true, true}, |
| 191 | } |
| 192 | |
| 193 | for _, tt := range tests { |
| 194 | t.Run(tt.name, func(t *testing.T) { |
| 195 | plan := NewExecutionPlan("Test") |
| 196 | plan.UserApproved = tt.userApproved |
| 197 | plan.Options.AutoApprove = tt.autoApprove |
| 198 | if plan.IsApproved() != tt.expected { |
| 199 | t.Errorf("expected %v, got %v", tt.expected, plan.IsApproved()) |
| 200 | } |
| 201 | }) |
| 202 | } |
| 203 | } |
| 204 | |
| 205 | func TestCanExecute(t *testing.T) { |
| 206 | tests := []struct { |
nothing calls this directly
no test coverage detected