mirror of
https://github.com/netbirdio/netbird.git
synced 2024-12-13 10:21:10 +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")
|
||
|
}
|
||
|
}
|