Skip to content

Commit

Permalink
Unit test corrections
Browse files Browse the repository at this point in the history
  • Loading branch information
mjunkin committed Oct 2, 2024
1 parent 384029a commit 37c49c7
Showing 1 changed file with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -285,12 +285,12 @@ void testEstimateMissingSiteIndicesStep2() throws ProcessingException, IOExcepti
fpe.processPolygon(polygon, ForwardProcessingEngine.ExecutionStep.ESTIMATE_MISSING_SITE_INDICES);

var sourceSiteCurve = SiteIndexEquation.SI_CWC_BARKER;
var sourceSiteIndex = 13.4;
var targetSiteCurve = SiteIndexEquation.SI_CWC_NIGH;
var sourceSiteIndex = 13.4f;
var targetSiteCurve = SiteIndexEquation.SI_HWC_WILEYAC;
double expectedValue = SiteTool
.convertSiteIndexBetweenCurves(sourceSiteCurve, sourceSiteIndex, targetSiteCurve);

assertThat(fpe.fps.getPrimaryLayerProcessingState().getBank().siteIndices[2], is((float) expectedValue));
assertThat(fpe.fps.getPrimaryLayerProcessingState().getBank().siteIndices[4], is((float) expectedValue));
}

@Test
Expand Down Expand Up @@ -319,7 +319,7 @@ void testEstimateMissingYearsToBreastHeightValues()

assertThat(
fpe.fps.getPrimaryLayerProcessingState().getBank().yearsToBreastHeight,
is(new float[] { 0.0f, 4.7f, 4.6f, 1.0f, 5.0f, 5.0f })
is(new float[] { 0.0f, 5.0f, 7.5f, 1.0f, 4.5f, 5.2f })
);
}

Expand Down Expand Up @@ -394,6 +394,6 @@ void testCalculateDominantHeightAgeSiteIndexNoSecondary()
assertThat(fpe.fps.getPrimaryLayerProcessingState().getPrimarySpeciesSiteIndex(), is(34.0f));
assertThat(fpe.fps.getPrimaryLayerProcessingState().getPrimarySpeciesTotalAge(), is(22.0f));
assertThat(fpe.fps.getPrimaryLayerProcessingState().getPrimarySpeciesAgeAtBreastHeight(), is(Float.NaN));
assertThat(fpe.fps.getPrimaryLayerProcessingState().getPrimarySpeciesAgeToBreastHeight(), is(4.7f));
assertThat(fpe.fps.getPrimaryLayerProcessingState().getPrimarySpeciesAgeToBreastHeight(), is(7.7f));
}
}

0 comments on commit 37c49c7

Please sign in to comment.