Skip to content

Commit 7f13fa8

Browse files
committed
Add TestFindTrollHouses
1 parent 853fba5 commit 7f13fa8

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

troll_shield_test.go

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,3 +93,24 @@ func TestEvents(t *testing.T) {
9393
}
9494

9595
}
96+
97+
func TestFindTrollHouses(t *testing.T) {
98+
botnilson := BotMockup{}
99+
trollGroups = []string{"@rolisvaldo"}
100+
if got := findTrollHouses(&botnilson, 1); got != "@rolisvaldo" {
101+
t.Errorf("findTrollHouses expects @rolisvaldo, got: %v", got)
102+
}
103+
if got := findTrollHouses(&botnilson, 2); got != "@rolisvaldo" {
104+
t.Errorf("findTrollHouses expects @rolisvaldo, got: %v", got)
105+
}
106+
if got := findTrollHouses(&botnilson, 3); got != "@rolisvaldo" {
107+
t.Errorf("findTrollHouses expects @rolisvaldo, got: %v", got)
108+
}
109+
if got := findTrollHouses(&botnilson, 4); got != "" {
110+
t.Errorf("findTrollHouses expects empty string, got: %v", got)
111+
}
112+
if got := findTrollHouses(&botnilson, -1); got != "" {
113+
t.Errorf("findTrollHouses expects empty string, got: %v", got)
114+
}
115+
}
116+

0 commit comments

Comments
 (0)