adds first unit test

This commit is contained in:
Hyatt 2023-03-26 10:28:43 -05:00
parent a9a8c49b34
commit f2df6e70e8
Signed by: nhyatt
GPG Key ID: C50D0BBB5BC40BEA

@ -0,0 +1,22 @@
package config
import (
"testing"
)
func TestGetDNSNames(t *testing.T) {
expected := []string{
"exampleService",
"exampleService.exampleNameSpace",
"exampleService.exampleNameSpace.svc",
"exampleService.exampleNameSpace.svc.cluster",
"exampleService.exampleNameSpace.svc.cluster.local",
}
result := getDNSNames("exampleService", "exampleNameSpace")
for i := range expected {
if result[i] != expected[i] {
t.Errorf("getDNSNames() failed to return the expected result, got %s, wanted %s", expected[i], result[i])
}
}
return
}