use of org.devgateway.ocds.web.rest.controller.request.YearFilterPagingRequest in project oc-explorer by devgateway.
the class OcdsControllerTest method ocdsPackages.
@Test
public void ocdsPackages() throws Exception {
final List<ReleasePackage> releasePackages = ocdsController.ocdsPackages(new YearFilterPagingRequest());
Assert.assertEquals(3, releasePackages.size());
}
use of org.devgateway.ocds.web.rest.controller.request.YearFilterPagingRequest in project oc-explorer by devgateway.
the class TenderPercentagesControllerTest method percentTendersAwarded.
@Test
public void percentTendersAwarded() throws Exception {
final List<DBObject> percentTendersAwarded = tenderPercentagesController.percentTendersAwarded(new YearFilterPagingRequest());
final DBObject first = percentTendersAwarded.get(0);
int year = (int) first.get(TenderPercentagesController.Keys.YEAR);
int totalTendersWithOneOrMoreTenderers = (int) first.get(TenderPercentagesController.Keys.TOTAL_TENDERS_WITH_ONE_OR_MORE_TENDERERS);
int totalTendersWithTwoOrMoreTenderers = (int) first.get(TenderPercentagesController.Keys.TOTAL_TENDERS_WITH_TWO_OR_MORE_TENDERERS);
double percentTenders = (double) first.get(TenderPercentagesController.Keys.PERCENT_TENDERS);
Assert.assertEquals(2014, year);
Assert.assertEquals(1, totalTendersWithOneOrMoreTenderers);
Assert.assertEquals(1, totalTendersWithTwoOrMoreTenderers);
Assert.assertEquals(100.0, percentTenders, 0);
final DBObject second = percentTendersAwarded.get(1);
year = (int) second.get(TenderPercentagesController.Keys.YEAR);
totalTendersWithOneOrMoreTenderers = (int) second.get(TenderPercentagesController.Keys.TOTAL_TENDERS_WITH_ONE_OR_MORE_TENDERERS);
totalTendersWithTwoOrMoreTenderers = (int) second.get(TenderPercentagesController.Keys.TOTAL_TENDERS_WITH_TWO_OR_MORE_TENDERERS);
percentTenders = (double) second.get(TenderPercentagesController.Keys.PERCENT_TENDERS);
Assert.assertEquals(2015, year);
Assert.assertEquals(2, totalTendersWithOneOrMoreTenderers);
Assert.assertEquals(1, totalTendersWithTwoOrMoreTenderers);
Assert.assertEquals(50.0, percentTenders, 0);
}
use of org.devgateway.ocds.web.rest.controller.request.YearFilterPagingRequest in project oc-explorer by devgateway.
the class TenderPercentagesControllerTest method percentTendersWithTwoOrMoreTenderers.
@Test
public void percentTendersWithTwoOrMoreTenderers() throws Exception {
final List<DBObject> percentTendersWithTwoOrMoreTenderers = tenderPercentagesController.percentTendersWithTwoOrMoreTenderers(new YearFilterPagingRequest());
final DBObject first = percentTendersWithTwoOrMoreTenderers.get(0);
int year = (int) first.get(TenderPercentagesController.Keys.YEAR);
int totalTenders = (int) first.get(TenderPercentagesController.Keys.TOTAL_TENDERS);
int totalTendersWithTwoOrMoreTenderers = (int) first.get(TenderPercentagesController.Keys.TOTAL_TENDERS_WITH_TWO_OR_MORE_TENDERERS);
double percentTenders = (double) first.get(TenderPercentagesController.Keys.PERCENT_TENDERS);
Assert.assertEquals(2014, year);
Assert.assertEquals(1, totalTenders);
Assert.assertEquals(1, totalTendersWithTwoOrMoreTenderers);
Assert.assertEquals(100.0, percentTenders, 0);
final DBObject second = percentTendersWithTwoOrMoreTenderers.get(1);
year = (int) second.get(TenderPercentagesController.Keys.YEAR);
totalTenders = (int) second.get(TenderPercentagesController.Keys.TOTAL_TENDERS);
totalTendersWithTwoOrMoreTenderers = (int) second.get(TenderPercentagesController.Keys.TOTAL_TENDERS_WITH_TWO_OR_MORE_TENDERERS);
percentTenders = (double) second.get(TenderPercentagesController.Keys.PERCENT_TENDERS);
Assert.assertEquals(2015, year);
Assert.assertEquals(2, totalTenders);
Assert.assertEquals(1, totalTendersWithTwoOrMoreTenderers);
Assert.assertEquals(50.0, percentTenders, 0);
}
use of org.devgateway.ocds.web.rest.controller.request.YearFilterPagingRequest in project oc-explorer by devgateway.
the class TenderPercentagesControllerTest method percentTendersUsingEBid.
@Test
public void percentTendersUsingEBid() throws Exception {
final List<DBObject> percentTendersUsingEBid = tenderPercentagesController.percentTendersUsingEBid(new YearFilterPagingRequest());
final DBObject first = percentTendersUsingEBid.get(0);
int year = (int) first.get(TenderPercentagesController.Keys.YEAR);
int totalTenders = (int) first.get(TenderPercentagesController.Keys.TOTAL_TENDERS);
int totalTendersUsingEbid = (int) first.get(TenderPercentagesController.Keys.TOTAL_TENDERS_USING_EBID);
double percentageTendersUsingEbid = (double) first.get(TenderPercentagesController.Keys.PERCENTAGE_TENDERS_USING_EBID);
Assert.assertEquals(2014, year);
Assert.assertEquals(1, totalTenders);
Assert.assertEquals(1, totalTendersUsingEbid);
Assert.assertEquals(100.0, percentageTendersUsingEbid, 0);
final DBObject second = percentTendersUsingEBid.get(1);
year = (int) second.get(TenderPercentagesController.Keys.YEAR);
totalTenders = (int) second.get(TenderPercentagesController.Keys.TOTAL_TENDERS);
totalTendersUsingEbid = (int) second.get(TenderPercentagesController.Keys.TOTAL_TENDERS_USING_EBID);
percentageTendersUsingEbid = (double) second.get(TenderPercentagesController.Keys.PERCENTAGE_TENDERS_USING_EBID);
Assert.assertEquals(2015, year);
Assert.assertEquals(1, totalTenders);
Assert.assertEquals(1, totalTendersUsingEbid);
Assert.assertEquals(100.0, percentageTendersUsingEbid, 0);
}
use of org.devgateway.ocds.web.rest.controller.request.YearFilterPagingRequest in project oc-explorer by devgateway.
the class TenderPriceByTypeYearControllerTest method tenderPriceByProcurementMethod.
@Test
public void tenderPriceByProcurementMethod() throws Exception {
final List<DBObject> tenderPriceByProcurementMethod = tenderPriceByTypeYearController.tenderPriceByProcurementMethod(new YearFilterPagingRequest());
final DBObject first = tenderPriceByProcurementMethod.get(0);
String procurementMethod = (String) first.get(TenderPriceByTypeYearController.Keys.PROCUREMENT_METHOD);
Number totalTenderAmount = (Number) first.get(TenderPriceByTypeYearController.Keys.TOTAL_TENDER_AMOUNT);
Assert.assertEquals("selective", procurementMethod);
Assert.assertEquals(600000.0, totalTenderAmount.doubleValue(), 0);
final DBObject second = tenderPriceByProcurementMethod.get(1);
procurementMethod = (String) second.get(TenderPriceByTypeYearController.Keys.PROCUREMENT_METHOD);
totalTenderAmount = (Number) second.get(TenderPriceByTypeYearController.Keys.TOTAL_TENDER_AMOUNT);
Assert.assertEquals("open", procurementMethod);
Assert.assertEquals(9000.0, totalTenderAmount.doubleValue(), 0);
}
Aggregations