Skip to content

Commit

Permalink
add overview points test
Browse files Browse the repository at this point in the history
  • Loading branch information
alaingilbert committed Sep 15, 2022
1 parent ffe0a4b commit 4083e1d
Show file tree
Hide file tree
Showing 2 changed files with 1,705 additions and 0 deletions.
9 changes: 9 additions & 0 deletions pkg/extractor/v9/extractor_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -123,3 +123,12 @@ func TestExtractResourceSettings(t *testing.T) {
settings, _, _ := NewExtractor().ExtractResourceSettings(pageHTMLBytes)
assert.Equal(t, ogame.ResourceSettings{MetalMine: 100, CrystalMine: 100, DeuteriumSynthesizer: 100, SolarPlant: 100, FusionReactor: 100, SolarSatellite: 100, Crawler: 100, PlasmaTechnology: 100}, settings)
}

func TestExtractUserInfos(t *testing.T) {
pageHTMLBytes, _ := ioutil.ReadFile("../../../samples/v9.0.4/en/overview.html")
info, err := NewExtractor().ExtractUserInfos(pageHTMLBytes)
assert.NoError(t, err)
assert.Equal(t, int64(30478), info.Points)
assert.Equal(t, int64(1102), info.Rank)
assert.Equal(t, int64(2931), info.Total)
}
Loading

0 comments on commit 4083e1d

Please sign in to comment.