add test for Stations

This commit is contained in:
Kent Gruber 2018-05-01 22:39:05 -04:00
commit a9a37593a6

View file

@ -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)
}
}