adds first unit test
This commit is contained in:
parent
a9a8c49b34
commit
f2df6e70e8
22
internal/config/initialize_test.go
Normal file
22
internal/config/initialize_test.go
Normal file
@ -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
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user