@Test
public void costEffectivenessTenderAmount() throws Exception {

    final List<Document> costEffectivenessTenderAmount = costEffectivenessVisualsController
            .costEffectivenessTenderAmount(new GroupingFilterPagingRequest());
    final Document first = costEffectivenessTenderAmount.get(0);
    int year = (int) first.get(CostEffectivenessVisualsController.Keys.YEAR);
    double totalTenderAmount = (double) first.get(CostEffectivenessVisualsController.Keys.TOTAL_TENDER_AMOUNT);
    int totalTenders = (int) first.get(CostEffectivenessVisualsController.Keys.TOTAL_TENDERS);
    int totalTenderWithAwards = (int) first.get(CostEffectivenessVisualsController.Keys.TOTAL_TENDER_WITH_AWARDS);
    double percentageTendersWithAwards = (double) first.
            get(CostEffectivenessVisualsController.Keys.PERCENTAGE_TENDERS_WITH_AWARDS);
    Assert.assertEquals(2014, year);
    Assert.assertEquals(600000.0, totalTenderAmount, 0);
    Assert.assertEquals(1, totalTenders);
    Assert.assertEquals(1, totalTenderWithAwards);
    Assert.assertEquals(100.0, percentageTendersWithAwards, 0);
    final Document second = costEffectivenessTenderAmount.get(1);
    year = (int) second.get(CostEffectivenessVisualsController.Keys.YEAR);
    totalTenderAmount = (double) second.get(CostEffectivenessVisualsController.Keys.TOTAL_TENDER_AMOUNT);
    totalTenders = (int) second.get(CostEffectivenessVisualsController.Keys.TOTAL_TENDERS);
    totalTenderWithAwards = (int) second.get(CostEffectivenessVisualsController.Keys.TOTAL_TENDER_WITH_AWARDS);
    percentageTendersWithAwards = (double) second
            .get(CostEffectivenessVisualsController.Keys.PERCENTAGE_TENDERS_WITH_AWARDS);
    Assert.assertEquals(2015, year);
    Assert.assertEquals(9000.0, totalTenderAmount, 0);
    Assert.assertEquals(2, totalTenders);
    Assert.assertEquals(1, totalTenderWithAwards);
    Assert.assertEquals(50.0, percentageTendersWithAwards, 0);
}