TestActionModeValidation tests the ActionMode type validation
(t *testing.T)
| 13 | |
| 14 | // TestActionModeValidation tests the ActionMode type validation |
| 15 | func TestActionModeValidation(t *testing.T) { |
| 16 | tests := []struct { |
| 17 | mode ActionMode |
| 18 | valid bool |
| 19 | }{ |
| 20 | {ActionModeDev, true}, |
| 21 | {ActionModeRelease, true}, |
| 22 | {ActionModeScript, true}, |
| 23 | {ActionModeAction, true}, |
| 24 | {ActionMode("invalid"), false}, |
| 25 | {ActionMode(""), false}, |
| 26 | } |
| 27 | |
| 28 | for _, tt := range tests { |
| 29 | t.Run(string(tt.mode), func(t *testing.T) { |
| 30 | if got := tt.mode.IsValid(); got != tt.valid { |
| 31 | t.Errorf("ActionMode(%q).IsValid() = %v, want %v", tt.mode, got, tt.valid) |
| 32 | } |
| 33 | }) |
| 34 | } |
| 35 | } |
| 36 | |
| 37 | // TestActionModeString tests the String() method |
| 38 | func TestActionModeString(t *testing.T) { |
nothing calls this directly
no test coverage detected