add test for Aliases

This commit is contained in:
Kent Gruber 2018-05-01 15:00:00 -04:00
commit 50ebf3e53a

View file

@ -107,3 +107,15 @@ func TestList(t *testing.T) {
t.Fatalf("expected '%d', got '%d'", exp, got)
}
}
func TestAliases(t *testing.T) {
exampleAlias := "picat"
exampleLAN := buildExampleLAN()
exampleEndpoint := buildExampleEndpoint()
exampleLAN.hosts[exampleEndpoint.HwAddress] = exampleEndpoint
exp := exampleAlias
got := exampleLAN.Aliases().Get(exampleEndpoint.HwAddress)
if got != exp {
t.Fatalf("expected '%v', got '%v'", exp, got)
}
}