use of org.devgateway.ocds.web.rest.controller.request.YearFilterPagingRequest in project oc-explorer by devgateway.
the class CorruptionRiskDashboardIndicatorsStatsControllerTest method percentTotalProjectsFlaggedByYearTest.
@Test
public void percentTotalProjectsFlaggedByYearTest() throws Exception {
final List<DBObject> result = corruptionRiskDashboardIndicatorsStatsController.percentTotalProjectsFlaggedByYear(new YearFilterPagingRequest());
Assert.assertEquals(1, result.size());
Assert.assertEquals(2015, result.get(0).get(CorruptionRiskDashboardIndicatorsStatsController.Keys.YEAR));
Assert.assertEquals(FlagType.RIGGING.toString(), result.get(0).get(CorruptionRiskDashboardIndicatorsStatsController.Keys.TYPE));
Assert.assertEquals(2, result.get(0).get(CorruptionRiskDashboardIndicatorsStatsController.Keys.FLAGGED_COUNT));
Assert.assertEquals(1, result.get(0).get(CorruptionRiskDashboardIndicatorsStatsController.Keys.FLAGGED_PROJECT_COUNT));
Assert.assertEquals(2, result.get(0).get(CorruptionRiskDashboardIndicatorsStatsController.Keys.PROJECT_COUNT));
Assert.assertTrue(BigDecimal.valueOf(50).compareTo((BigDecimal) result.get(0).get(CorruptionRiskDashboardIndicatorsStatsController.Keys.PERCENT)) == 0);
}
use of org.devgateway.ocds.web.rest.controller.request.YearFilterPagingRequest in project oc-explorer by devgateway.
the class CorruptionRiskDashboardIndicatorsStatsControllerTest method totalFlagsByIndicatorTypeTest.
@Test
public void totalFlagsByIndicatorTypeTest() throws Exception {
final List<DBObject> result = corruptionRiskDashboardIndicatorsStatsController.totalFlaggedIndicatorsByIndicatorType(new YearFilterPagingRequest());
Assert.assertEquals(1, result.size());
Assert.assertEquals(FlagType.RIGGING.toString(), result.get(0).get(CorruptionRiskDashboardIndicatorsStatsController.Keys.TYPE));
Assert.assertEquals(2, result.get(0).get(CorruptionRiskDashboardIndicatorsStatsController.Keys.INDICATOR_COUNT));
}
use of org.devgateway.ocds.web.rest.controller.request.YearFilterPagingRequest in project oc-explorer by devgateway.
the class FundingByLocationControllerTest method qualityFundingByTenderDeliveryLocation.
@Test
public void qualityFundingByTenderDeliveryLocation() throws Exception {
final List<DBObject> qualityFundingByTenderDeliveryLocation = fundingByLocationController.qualityFundingByTenderDeliveryLocation(new YearFilterPagingRequest());
final DBObject first = qualityFundingByTenderDeliveryLocation.get(0);
int totalTendersWithStartDate = (int) first.get(FundingByLocationController.Keys.TOTAL_TENDERS_WITH_START_DATE);
int totalTendersWithStartDateAndLocation = (int) first.get(FundingByLocationController.Keys.TOTAL_TENDERS_WITH_START_DATE_AND_LOCATION);
double percentTendersWithStartDateAndLocation = (double) first.get(FundingByLocationController.Keys.PERCENT_TENDERS_WITH_START_DATE_AND_LOCATION);
Assert.assertEquals(3, totalTendersWithStartDate);
Assert.assertEquals(1, totalTendersWithStartDateAndLocation);
Assert.assertEquals(33.33, percentTendersWithStartDateAndLocation, 1E-2);
}
use of org.devgateway.ocds.web.rest.controller.request.YearFilterPagingRequest in project oc-explorer by devgateway.
the class LocationInfowindowControllerTest method planningByLocation.
@Test
public void planningByLocation() throws Exception {
final List<DBObject> planningByLocation = locationInfowindowController.planningByLocation(new YearFilterPagingRequest());
Assert.assertEquals(1, planningByLocation.size());
final DBObject first = planningByLocation.get(0);
}
use of org.devgateway.ocds.web.rest.controller.request.YearFilterPagingRequest in project oc-explorer by devgateway.
the class LocationInfowindowControllerTest method awardsByLocation.
@Test
public void awardsByLocation() throws Exception {
final List<DBObject> awardsByLocation = locationInfowindowController.awardsByLocation(new YearFilterPagingRequest());
Assert.assertEquals(1, awardsByLocation.size());
final DBObject first = awardsByLocation.get(0);
}
Aggregations