mirror of
https://github.com/netbirdio/netbird.git
synced 2024-11-26 10:03:47 +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")
|
||
|
}
|
||
|
}
|