Skip to content

Commit

Permalink
add test
Browse files Browse the repository at this point in the history
  • Loading branch information
alaingilbert committed Sep 24, 2022
1 parent 44c3905 commit 8eae33f
Show file tree
Hide file tree
Showing 2 changed files with 1,643 additions and 0 deletions.
19 changes: 19 additions & 0 deletions pkg/extractor/v9/extractor_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -160,3 +160,22 @@ func TestExtractLfBuildings(t *testing.T) {
assert.Equal(t, int64(0), res.Metropolis)
assert.Equal(t, int64(0), res.PlanetaryShield)
}

func TestExtractLfBuildingsRocktal(t *testing.T) {
pageHTMLBytes, _ := ioutil.ReadFile("../../../samples/v9.0.4/en/lifeform/lfbuildings_rocktal.html")
res, _ := NewExtractor().ExtractLfBuildings(pageHTMLBytes)
assert.Equal(t, int64(0), res.ResidentialSector)
assert.Equal(t, int64(0), res.BiosphereFarm)
assert.Equal(t, int64(0), res.ResearchCentre)
assert.Equal(t, int64(0), res.AcademyOfSciences)
assert.Equal(t, int64(0), res.NeuroCalibrationCentre)
assert.Equal(t, int64(0), res.HighEnergySmelting)
assert.Equal(t, int64(0), res.FoodSilo)
assert.Equal(t, int64(0), res.FusionPoweredProduction)
assert.Equal(t, int64(0), res.Skyscraper)
assert.Equal(t, int64(0), res.BiotechLab)
assert.Equal(t, int64(0), res.Metropolis)
assert.Equal(t, int64(0), res.PlanetaryShield)
assert.Equal(t, int64(2), res.MeditationEnclave)
assert.Equal(t, int64(1), res.CrystalFarm)
}
Loading

0 comments on commit 8eae33f

Please sign in to comment.