Skip to content

Commit

Permalink
Add TestFindTrollHouses
Browse files Browse the repository at this point in the history
  • Loading branch information
ryukinix committed Jul 24, 2020
1 parent 853fba5 commit 7f13fa8
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions troll_shield_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -93,3 +93,24 @@ func TestEvents(t *testing.T) {
}

}

func TestFindTrollHouses(t *testing.T) {
botnilson := BotMockup{}
trollGroups = []string{"@rolisvaldo"}
if got := findTrollHouses(&botnilson, 1); got != "@rolisvaldo" {
t.Errorf("findTrollHouses expects @rolisvaldo, got: %v", got)
}
if got := findTrollHouses(&botnilson, 2); got != "@rolisvaldo" {
t.Errorf("findTrollHouses expects @rolisvaldo, got: %v", got)
}
if got := findTrollHouses(&botnilson, 3); got != "@rolisvaldo" {
t.Errorf("findTrollHouses expects @rolisvaldo, got: %v", got)
}
if got := findTrollHouses(&botnilson, 4); got != "" {
t.Errorf("findTrollHouses expects empty string, got: %v", got)
}
if got := findTrollHouses(&botnilson, -1); got != "" {
t.Errorf("findTrollHouses expects empty string, got: %v", got)
}
}

0 comments on commit 7f13fa8

Please sign in to comment.