Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
alaingilbert committed Sep 15, 2022
1 parent 99ed608 commit ffe0a4b
Show file tree
Hide file tree
Showing 4 changed files with 2,048 additions and 4 deletions.
4 changes: 2 additions & 2 deletions pkg/extractor/v9/extractor_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ func TestGetConstructions(t *testing.T) {
}

func TestExtractResourceSettings(t *testing.T) {
pageHTMLBytes, _ := ioutil.ReadFile("../../../samples/v9.0.4/resource_settings.html")
pageHTMLBytes, _ := ioutil.ReadFile("../../../samples/v9.0.4/en/resource_settings.html")
settings, _, _ := NewExtractor().ExtractResourceSettings(pageHTMLBytes)
assert.Equal(t, ogame.ResourceSettings{MetalMine: 100, CrystalMine: 100, DeuteriumSynthesizer: 0, SolarPlant: 100, FusionReactor: 0, SolarSatellite: 0, Crawler: 0, PlasmaTechnology: 0}, settings)
assert.Equal(t, ogame.ResourceSettings{MetalMine: 100, CrystalMine: 100, DeuteriumSynthesizer: 100, SolarPlant: 100, FusionReactor: 100, SolarSatellite: 100, Crawler: 100, PlasmaTechnology: 100}, settings)
}
2 changes: 1 addition & 1 deletion pkg/ogame/resourceSettings.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,5 @@ func (r ResourceSettings) String() string {
" Fusion Reactor: " + utils.FI64(r.FusionReactor) + "\n" +
" Solar Satellite: " + utils.FI64(r.SolarSatellite) + "\n" +
" Crawler: " + utils.FI64(r.Crawler) + "\n" +
" PlasmaTechnology: " + utils.FI64(r.PlasmaTechnology)
" Plasma Technology: " + utils.FI64(r.PlasmaTechnology)
}
4 changes: 3 additions & 1 deletion pkg/ogame/resourceSettings_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ func TestResourceSettings_String(t *testing.T) {
FusionReactor: 5,
SolarSatellite: 6,
Crawler: 7,
PlasmaTechnology: 8,
}
expected := "\n" +
" Metal Mine: 1\n" +
Expand All @@ -23,6 +24,7 @@ func TestResourceSettings_String(t *testing.T) {
" Solar Plant: 4\n" +
" Fusion Reactor: 5\n" +
" Solar Satellite: 6\n" +
" Crawler: 7"
" Crawler: 7\n" +
" Plasma Technology: 8"
assert.Equal(t, expected, r.String())
}
Loading

0 comments on commit ffe0a4b

Please sign in to comment.