package clients

import (
	"context"
	"testing"

	"github.com/stretchr/testify/assert"
)

func TestInitGRPCDial(t *testing.T) {

	tests := []struct {
		name         string
		errorMessage string
		host         string
	}{
		{
			name:         "test invalid host",
			errorMessage: "init grpc dial failed",
			host:         "0.0.0.0:00",
		},
		{
			name:         "test empty host",
			errorMessage: "need to set the grpc hostname",
		},
		{
			name:         "test invalid host with TLS",
			errorMessage: "init grpc dial failed",
			host:         "0.0.0.0:00",
		},
	}
	for _, test := range tests {
		t.Run(test.name, func(t *testing.T) {
			_, err := InitCallistoSOGrpcClient(context.TODO(), test.host)
			assert.ErrorContains(t, err, test.errorMessage)
		})
	}

}
