mirror of
https://github.com/bettercap/bettercap
synced 2025-08-21 14:03:17 -07:00
add test for AddIfNew
This commit is contained in:
parent
aa69d7499a
commit
116ae12194
1 changed files with 13 additions and 0 deletions
|
@ -93,3 +93,16 @@ func TestWiFiRemove(t *testing.T) {
|
|||
t.Fatalf("expected '%v', got '%v'", exp, got)
|
||||
}
|
||||
}
|
||||
|
||||
func TestWiFiAddIfNew(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
|
||||
exampleWiFi.AddIfNew("my_wifi2", "ff:ff:ff:ff:ff:f3", 2472, int8(0))
|
||||
exp := 3
|
||||
got := len(exampleWiFi.List())
|
||||
if got != exp {
|
||||
t.Fatalf("expected '%v', got '%v'", exp, got)
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue