package clients

import (
	"fmt"
	"net/http"
	"reflect"
	"testing"

	"github.com/stretchr/testify/assert"
)

func TestInitClient(t *testing.T) {
	t.Run("test NewHTTP should return a new httpClient", func(t *testing.T) {
		httpClient := NewHTTP()
		var want = &HTTPProxyClient{}
		var err error
		if !reflect.DeepEqual(httpClient, want) {
			err = fmt.Errorf("Config_not_equals, New() = %v, want %v", httpClient, want)
		}
		assert.NoError(t, err)
	})

	t.Run("test Setters test httpClient builder", func(t *testing.T) {
		client := http.DefaultClient
		var expected *HTTPProxyClient
		httpProxyClient := NewHTTP().SetHTTPClient(client)
		assert.IsType(t, expected, httpProxyClient)
	})
}
