diff --git a/internal/cmd/config/list/list_test.go b/internal/cmd/config/list/list_test.go new file mode 100644 index 000000000..d32d5d76a --- /dev/null +++ b/internal/cmd/config/list/list_test.go @@ -0,0 +1,35 @@ +package list + +import ( + "testing" + + "github.com/stackitcloud/stackit-cli/internal/pkg/print" +) + +func TestOutputResult(t *testing.T) { + type args struct { + outputFormat string + configData map[string]any + activeProfile string + } + tests := []struct { + name string + args args + wantErr bool + }{ + { + name: "empty", + args: args{}, + wantErr: false, + }, + } + p := print.NewPrinter() + p.Cmd = NewCmd(p) + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + if err := outputResult(p, tt.args.outputFormat, tt.args.configData, tt.args.activeProfile); (err != nil) != tt.wantErr { + t.Errorf("outputResult() error = %v, wantErr %v", err, tt.wantErr) + } + }) + } +} diff --git a/internal/cmd/config/profile/list/list_test.go b/internal/cmd/config/profile/list/list_test.go new file mode 100644 index 000000000..80e080c56 --- /dev/null +++ b/internal/cmd/config/profile/list/list_test.go @@ -0,0 +1,34 @@ +package list + +import ( + "testing" + + "github.com/stackitcloud/stackit-cli/internal/pkg/print" +) + +func TestOutputResult(t *testing.T) { + type args struct { + outputFormat string + profiles []profileInfo + } + tests := []struct { + name string + args args + wantErr bool + }{ + { + name: "empty", + args: args{}, + wantErr: false, + }, + } + p := print.NewPrinter() + p.Cmd = NewCmd(p) + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + if err := outputResult(p, tt.args.outputFormat, tt.args.profiles); (err != nil) != tt.wantErr { + t.Errorf("outputResult() error = %v, wantErr %v", err, tt.wantErr) + } + }) + } +}