mirror of
https://github.com/bettercap/bettercap
synced 2025-08-21 05:53:20 -07:00
add test for Get
This commit is contained in:
parent
29486e1bf7
commit
e9697e0659
1 changed files with 13 additions and 0 deletions
|
@ -79,3 +79,16 @@ func TestSetAliasFor(t *testing.T) {
|
||||||
t.Error("unable to set alias for a given mac address")
|
t.Error("unable to set alias for a given mac address")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func TestGet(t *testing.T) {
|
||||||
|
exampleLAN := buildExampleLAN()
|
||||||
|
exampleEndpoint := buildExampleEndpoint()
|
||||||
|
exampleLAN.hosts[exampleEndpoint.HwAddress] = exampleEndpoint
|
||||||
|
foundEndpoint, foundBool := exampleLAN.Get(exampleEndpoint.HwAddress)
|
||||||
|
if foundEndpoint != exampleEndpoint {
|
||||||
|
t.Fatalf("expected '%v', got '%v'", foundEndpoint, exampleEndpoint)
|
||||||
|
}
|
||||||
|
if !foundBool {
|
||||||
|
t.Error("unable to get known endpoint via mac address from LAN struct")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue