use of org.activityinfo.legacy.shared.command.result.PartnerResult in project activityinfo by bedatadriven.
the class GetPartnersDimensionHandlerTest method testSiteCountIndicators.
@Test
@OnDataSet("/dbunit/sites-simple1.db.xml")
public void testSiteCountIndicators() throws CommandException {
/*
Activity #1
Indicator #103 (site count)
Indicator #675 (site count)
Site #1: Partner #1
Site #2: Partner #1
Site #3: partner #2
*/
// empty
PartnerResult result = execute(DimensionType.Indicator, 103, 675);
// indicators 103 and 675 are site count indicators, so all sites of activity #1
// should have a non empty value and be considered present
assertThat(result.getData().size(), equalTo(2));
}
use of org.activityinfo.legacy.shared.command.result.PartnerResult in project activityinfo by bedatadriven.
the class GetPartnersDimensionHandlerTest method testIndicatorLinked2.
@Test
@OnDataSet("/dbunit/sites-linked.db.xml")
public void testIndicatorLinked2() throws CommandException {
/*
Database #1 > Activity #1 (once)
Site #2: Partner #1
I1=400
Database #2 > Activity #2 (once)
Site #1: Partner #1
I3=1500
Links
I3 -> I2
*/
// NRC
PartnerResult result = execute(DimensionType.Indicator, 2);
assertThat(result.getData().size(), equalTo(1));
assertThat(result.getData().get(0).getName(), equalTo("NRC"));
}
use of org.activityinfo.legacy.shared.command.result.PartnerResult in project activityinfo by bedatadriven.
the class GetPartnersDimensionHandlerTest method testIndicatorLinked12100.
@Test
@OnDataSet("/dbunit/sites-linked.db.xml")
public void testIndicatorLinked12100() throws CommandException {
// NRC, NRC2
PartnerResult result = execute(DimensionType.Indicator, 1, 2, 100);
assertThat(result.getData().size(), equalTo(2));
assertThat(result.getData().get(0).getName(), equalTo("NRC"));
assertThat(result.getData().get(1).getName(), equalTo("NRC2"));
}
Aggregations