mirror of
https://github.com/netbirdio/netbird.git
synced 2024-11-29 03:23:56 +01:00
25 lines
367 B
Go
25 lines
367 B
Go
|
package dns
|
||
|
|
||
|
import (
|
||
|
"testing"
|
||
|
)
|
||
|
|
||
|
func TestGetServerDns(t *testing.T) {
|
||
|
_, err := GetServerDns()
|
||
|
if err == nil {
|
||
|
t.Errorf("invalid dns server instance")
|
||
|
}
|
||
|
|
||
|
srv := &MockServer{}
|
||
|
setServerDns(srv)
|
||
|
|
||
|
srvB, err := GetServerDns()
|
||
|
if err != nil {
|
||
|
t.Errorf("invalid dns server instance: %s", err)
|
||
|
}
|
||
|
|
||
|
if srvB != srv {
|
||
|
t.Errorf("missmatch dns instances")
|
||
|
}
|
||
|
}
|