mirror of
https://github.com/bettercap/bettercap
synced 2025-08-19 13:09:49 -07:00
add test for List
This commit is contained in:
parent
e9697e0659
commit
a3e173a847
1 changed files with 15 additions and 0 deletions
|
@ -92,3 +92,18 @@ func TestGet(t *testing.T) {
|
||||||
t.Error("unable to get known endpoint via mac address from LAN struct")
|
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)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue