2021-12-11 06:41:35 +05:30
|
|
|
package utils
|
|
|
|
|
2021-12-20 17:33:11 +05:30
|
|
|
import (
|
|
|
|
"testing"
|
|
|
|
|
|
|
|
"github.com/stretchr/testify/assert"
|
|
|
|
)
|
2021-12-11 06:41:35 +05:30
|
|
|
|
|
|
|
func TestGetHostName(t *testing.T) {
|
|
|
|
authorizer_url := "http://test.herokuapp.com"
|
|
|
|
|
|
|
|
got := GetHostName(authorizer_url)
|
|
|
|
want := "test.herokuapp.com"
|
|
|
|
|
2021-12-20 17:33:11 +05:30
|
|
|
assert.Equal(t, got, want, "hostname should be equal")
|
2021-12-11 06:41:35 +05:30
|
|
|
}
|
|
|
|
|
|
|
|
func TestGetDomainName(t *testing.T) {
|
|
|
|
authorizer_url := "http://test.herokuapp.com"
|
|
|
|
|
|
|
|
got := GetDomainName(authorizer_url)
|
|
|
|
want := "herokuapp.com"
|
|
|
|
|
2021-12-20 17:33:11 +05:30
|
|
|
assert.Equal(t, got, want, "domain name should be equal")
|
2021-12-11 06:41:35 +05:30
|
|
|
}
|