use of org.devgateway.ocds.web.rest.controller.request.YearFilterPagingRequest in project ocvn by devgateway.
the class VNImportAndEndpointsTest method testAverageNumberOfTenderersController.
@Test
public void testAverageNumberOfTenderersController() {
List<DBObject> averageNumberOfTenderers = averageNumberOfTenderersController.averageNumberOfTenderers(new YearFilterPagingRequest());
DBObject root = averageNumberOfTenderers.get(0);
int year = (int) root.get("year");
Assert.assertEquals(2012, year);
double averageNoTenderers = (double) root.get("averageNoTenderers");
Assert.assertEquals(2, averageNoTenderers, 0);
root = averageNumberOfTenderers.get(1);
year = (int) root.get("year");
Assert.assertEquals(2013, year);
averageNoTenderers = (double) root.get("averageNoTenderers");
Assert.assertEquals(2, averageNoTenderers, 0);
}
use of org.devgateway.ocds.web.rest.controller.request.YearFilterPagingRequest in project ocvn by devgateway.
the class VNImportAndEndpointsTest method testAverageAwardPeriod.
@Test
public void testAverageAwardPeriod() {
List<DBObject> averageAwardPeriod = averageTenderAndAwardPeriodsController.averageAwardPeriod(new YearFilterPagingRequest());
DBObject root = averageAwardPeriod.get(0);
int year = (int) root.get(AverageTenderAndAwardPeriodsController.Keys.YEAR);
Assert.assertEquals(2014, year);
double n = (double) root.get("averageAwardDays");
Assert.assertEquals(536, n, 0);
}
use of org.devgateway.ocds.web.rest.controller.request.YearFilterPagingRequest in project ocvn by devgateway.
the class VNImportAndEndpointsTest method testCostEffectivenessAwardAmount.
@Test
public void testCostEffectivenessAwardAmount() {
List<DBObject> costEffectivenessAwardAmount = costEffectivenessVisualsController.costEffectivenessAwardAmount(new YearFilterPagingRequest());
DBObject root = costEffectivenessAwardAmount.get(0);
int year = (int) root.get(CostEffectivenessVisualsController.Keys.YEAR);
Assert.assertEquals(2012, year);
double totalAwardAmount = (double) root.get("totalAwardAmount");
Assert.assertEquals(1000, totalAwardAmount, 0);
}
use of org.devgateway.ocds.web.rest.controller.request.YearFilterPagingRequest in project ocvn by devgateway.
the class TopTenControllerTest method topTenLargestSuppliers.
@Test
public void topTenLargestSuppliers() throws Exception {
final List<DBObject> topTenLargestSuppliers = topTenController.topTenLargestSuppliers(new YearFilterPagingRequest());
final DBObject first = topTenLargestSuppliers.get(0);
Assert.assertEquals(6000000d, first.get(TopTenController.Keys.TOTAL_AWARD_AMOUNT));
Assert.assertEquals(1, first.get(TopTenController.Keys.TOTAL_CONTRACTS));
Assert.assertEquals("E09000005", ((Collection) first.get(TopTenController.Keys.PROCURING_ENTITY_IDS)).iterator().next());
Assert.assertEquals("GB-COH-1234567845", first.get(TopTenController.Keys.SUPPLIER_ID));
Assert.assertEquals(1, first.get(TopTenController.Keys.PROCURING_ENTITY_IDS_COUNT));
Assert.assertEquals(2, topTenLargestSuppliers.size());
}
use of org.devgateway.ocds.web.rest.controller.request.YearFilterPagingRequest in project ocvn by devgateway.
the class TopTenControllerTest method topTenLargestAwards.
@Test
public void topTenLargestAwards() throws Exception {
final List<DBObject> topTenLargestAwards = topTenController.topTenLargestAwards(new YearFilterPagingRequest());
Assert.assertEquals(2, topTenLargestAwards.size());
final DBObject first = topTenLargestAwards.get(0);
BasicDBObject awards = (BasicDBObject) first.get("awards");
BasicDBObject value = (BasicDBObject) awards.get("value");
double amount = (double) value.get("amount");
Assert.assertEquals(6000000.0, amount, 0);
final DBObject second = topTenLargestAwards.get(1);
awards = (BasicDBObject) second.get("awards");
value = (BasicDBObject) awards.get("value");
amount = (double) value.get("amount");
Assert.assertEquals(40000.0, amount, 0);
}
Aggregations