-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdbd_test.go
48 lines (45 loc) · 1.33 KB
/
dbd_test.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
package main
import (
"strings"
"testing"
)
/**
Test anything that uses calculation outside of the discordgo commands.
Those commands don't need to be tested since they are verified to work
at github.com/bwmarrin/discordgo
**/
func TestDBD(t *testing.T) {
// t.Run("Shrine scrapes correctly", func(t *testing.T) {
// shrine := scrapeShrine()
// perkCount := 4
// if len(shrine.Perks) != perkCount || len(shrine.Prices) != perkCount || len(shrine.Owners) != perkCount {
// t.Logf("Failed to pull the expected %d perks", perkCount)
// t.Fail()
// }
// if shrine.TimeUntilReset == "" {
// t.Logf("Failed to detect time until shrine resets")
// t.Fail()
// }
// })
// just using one perk. this will fail if the design scheme for perks
// the website changes significantly.
t.Run("Perks scrape correctly", func(t *testing.T) {
perk := scrapePerk("Lithe")
if perk.PageURL != "https://deadbydaylight.gamepedia.com/Lithe" {
t.Logf("Failed to pull from correct URL")
t.Fail()
}
if strings.Contains(perk.IconURL, "Lithe.gif") == false {
t.Logf("Failed to pull correct icon")
t.Fail()
}
if perk.Name != "Lithe" {
t.Logf("Failed to pull the correct perk")
t.Fail()
}
if perk.Quote != "\"U mad?\" — Feng Min " {
t.Logf("Failed to populate quote correctly: '" + perk.Quote + "'")
t.Fail()
}
})
}