Skip to content

Commit

Permalink
add test for guild at war (#266)
Browse files Browse the repository at this point in the history
  • Loading branch information
tobiasehlert authored Oct 9, 2023
1 parent 42c5ee5 commit 7f8132a
Show file tree
Hide file tree
Showing 2 changed files with 932 additions and 0 deletions.
29 changes: 29 additions & 0 deletions src/TibiaGuildsGuild_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -177,3 +177,32 @@ func TestKotkiAntica(t *testing.T) {
assert.Equal("2021-09-22", guild.Founded)
assert.False(guild.Applications)
}

func TestNightsWatch(t *testing.T) {
file, err := static.TestFiles.Open("testdata/guilds/guild/Nights Watch.html")
if err != nil {
t.Fatalf("file opening error: %s", err)
}
defer file.Close()

data, err := io.ReadAll(file)
if err != nil {
t.Fatalf("File reading error: %s", err)
}

nightswatchJson, err := TibiaGuildsGuildImpl("Nights Watch", string(data))
if err != nil {
t.Fatal(err)
}

assert := assert.New(t)
guild := nightswatchJson.Guild

assert.Equal("Nights Watch", guild.Name)
assert.Equal("Luminera", guild.World)
assert.Empty(guild.Description)
assert.True(guild.Active)
assert.True(guild.InWar)
assert.Equal("2022-09-25", guild.Founded)
assert.False(guild.Applications)
}
Loading

0 comments on commit 7f8132a

Please sign in to comment.