From 1ea270e894c15a8da67adf5831fe1f3634185203 Mon Sep 17 00:00:00 2001 From: Alain Gilbert Date: Fri, 5 Aug 2022 06:35:21 -0700 Subject: [PATCH] add test for extract all resources tw 9.0.2 --- ogame_test.go | 7 + samples/v9.0.2/tw/traderauctioneer.html | 662 ++++++++++++++++++++++++ 2 files changed, 669 insertions(+) create mode 100644 samples/v9.0.2/tw/traderauctioneer.html diff --git a/ogame_test.go b/ogame_test.go index 9800fb43..aede4e80 100644 --- a/ogame_test.go +++ b/ogame_test.go @@ -3259,6 +3259,13 @@ func TestExtractAllResources(t *testing.T) { assert.Equal(t, Resources{Metal: 0, Crystal: 0, Deuterium: 2676231}, resources[33741598]) } +func TestExtractAllResourcesTwV902(t *testing.T) { + pageHTMLBytes, _ := ioutil.ReadFile("samples/v9.0.2/tw/traderauctioneer.html") + resources, _ := NewExtractorV71().ExtractAllResources(pageHTMLBytes) + assert.Equal(t, 1, len(resources)) + assert.Equal(t, Resources{Metal: 1005, Crystal: 1002, Deuterium: 0}, resources[33620229]) +} + func TestExtractDMCosts(t *testing.T) { pageHTMLBytes, _ := ioutil.ReadFile("samples/v7.1/en/overview_allDM.html") dmCosts, _ := NewExtractorV71().ExtractDMCosts(pageHTMLBytes) diff --git a/samples/v9.0.2/tw/traderauctioneer.html b/samples/v9.0.2/tw/traderauctioneer.html new file mode 100644 index 00000000..6cb0c6df --- /dev/null +++ b/samples/v9.0.2/tw/traderauctioneer.html @@ -0,0 +1,662 @@ +
+ +
\ No newline at end of file