diff --git a/network/wifi_test.go b/network/wifi_test.go index 96931872..88896cd3 100644 --- a/network/wifi_test.go +++ b/network/wifi_test.go @@ -56,3 +56,15 @@ func TestEachAccessPoint(t *testing.T) { t.Error("unable to perform callback function for each access point") } } + +func TestStations(t *testing.T) { + exampleWiFi := buildExampleWiFi() + exampleAP := NewAccessPoint("my_wifi", "ff:ff:ff:ff:ff:ff", 2472, int8(0)) + exampleWiFi.aps["ff:ff:ff:ff:ff:f1"] = exampleAP + exampleWiFi.aps["ff:ff:ff:ff:ff:f2"] = exampleAP + exp := 2 + got := len(exampleWiFi.Stations()) + if got != exp { + t.Fatalf("expected '%v', got '%v'", exp, got) + } +}