add test for Has

This commit is contained in:
Kent Gruber 2018-05-01 15:02:14 -04:00
parent effbf951b5
commit 050eaaf6bc

View file

@ -134,3 +134,12 @@ func TestWasMissed(t *testing.T) {
// TODO Add TestRemove after removing unnecessary ip argument
// func TestRemove(t *testing.T) {
// }
func TestHas(t *testing.T) {
exampleLAN := buildExampleLAN()
exampleEndpoint := buildExampleEndpoint()
exampleLAN.hosts[exampleEndpoint.HwAddress] = exampleEndpoint
if !exampleLAN.Has(exampleEndpoint.IpAddress) {
t.Error("unable find a known IP address in LAN struct")
}
}