From a3e173a847933a1b2ee66948dc9473754f3ba400 Mon Sep 17 00:00:00 2001 From: Kent Gruber Date: Tue, 1 May 2018 14:59:41 -0400 Subject: [PATCH] add test for List --- network/lan_test.go | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/network/lan_test.go b/network/lan_test.go index 79ba4d76..a5c2e268 100644 --- a/network/lan_test.go +++ b/network/lan_test.go @@ -92,3 +92,18 @@ func TestGet(t *testing.T) { t.Error("unable to get known endpoint via mac address from LAN struct") } } + +func TestList(t *testing.T) { + exampleLAN := buildExampleLAN() + exampleEndpoint := buildExampleEndpoint() + exampleLAN.hosts[exampleEndpoint.HwAddress] = exampleEndpoint + foundList := exampleLAN.List() + if len(foundList) != 1 { + t.Fatalf("expected '%d', got '%d'", 1, len(foundList)) + } + exp := 1 + got := len(exampleLAN.List()) + if got != exp { + t.Fatalf("expected '%d', got '%d'", exp, got) + } +}