use of org.openlmis.stockmanagement.testutils.StockCardSummaryV2DtoDataBuilder in project openlmis-stockmanagement by OpenLMIS.
the class StockCardSummaryV2DtoTest method shouldCompareStockCards.
@Test
public void shouldCompareStockCards() {
StockCardSummaryV2Dto stockCard1 = new StockCardSummaryV2DtoDataBuilder().withCanFulfillForMe(new CanFulfillForMeEntryDtoDataBuilder().build()).build();
StockCardSummaryV2Dto stockCard2 = new StockCardSummaryV2DtoDataBuilder().build();
assertEquals(-1, stockCard1.compareTo(stockCard2));
stockCard2 = new StockCardSummaryV2DtoDataBuilder().withCanFulfillForMe(new CanFulfillForMeEntryDtoDataBuilder().build()).build();
assertEquals(0, stockCard1.compareTo(stockCard2));
stockCard1 = new StockCardSummaryV2DtoDataBuilder().build();
stockCard2 = new StockCardSummaryV2DtoDataBuilder().build();
assertEquals(0, stockCard1.compareTo(stockCard2));
stockCard2 = new StockCardSummaryV2DtoDataBuilder().withCanFulfillForMe(new CanFulfillForMeEntryDtoDataBuilder().build()).build();
assertEquals(1, stockCard1.compareTo(stockCard2));
}
use of org.openlmis.stockmanagement.testutils.StockCardSummaryV2DtoDataBuilder in project openlmis-stockmanagement by OpenLMIS.
the class StockCardSummaryV2DtoTest method shouldGetStockOnHand.
@Test
public void shouldGetStockOnHand() {
StockCardSummaryV2Dto stockCard = new StockCardSummaryV2DtoDataBuilder().withCanFulfillForMe(new CanFulfillForMeEntryDtoDataBuilder().withStockOnHand(null).build()).withCanFulfillForMe(new CanFulfillForMeEntryDtoDataBuilder().withStockOnHand(12).build()).build();
assertEquals(new Integer(12), stockCard.getStockOnHand());
}
use of org.openlmis.stockmanagement.testutils.StockCardSummaryV2DtoDataBuilder in project openlmis-stockmanagement by OpenLMIS.
the class StockCardSummaryV2DtoTest method shouldGetNullStockOnHandIfCanFulfillForMeIsNullOrEmpty.
@Test
public void shouldGetNullStockOnHandIfCanFulfillForMeIsNullOrEmpty() {
StockCardSummaryV2Dto stockCard = new StockCardSummaryV2DtoDataBuilder().withCanFulfillForMe((Set<CanFulfillForMeEntryDto>) null).build();
assertEquals(null, stockCard.getStockOnHand());
stockCard = new StockCardSummaryV2DtoDataBuilder().build();
assertEquals(null, stockCard.getStockOnHand());
}
use of org.openlmis.stockmanagement.testutils.StockCardSummaryV2DtoDataBuilder in project openlmis-stockmanagement by OpenLMIS.
the class StockCardSummaryV2DtoTest method shouldGetNullStockOnHandIfCanFulfillDoesNotHaveStockOnHand.
@Test
public void shouldGetNullStockOnHandIfCanFulfillDoesNotHaveStockOnHand() {
StockCardSummaryV2Dto stockCard = new StockCardSummaryV2DtoDataBuilder().withCanFulfillForMe(new CanFulfillForMeEntryDtoDataBuilder().withStockOnHand(null).build()).withCanFulfillForMe(new CanFulfillForMeEntryDtoDataBuilder().withStockOnHand(null).build()).build();
assertEquals(null, stockCard.getStockOnHand());
}
use of org.openlmis.stockmanagement.testutils.StockCardSummaryV2DtoDataBuilder in project openlmis-stockmanagement by OpenLMIS.
the class StockCardSummaryV2DtoTest method shouldImplementToString.
@Test
public void shouldImplementToString() {
StockCardSummaryV2Dto stockCard = new StockCardSummaryV2DtoDataBuilder().build();
ToStringTestUtils.verify(StockCardSummaryV2Dto.class, stockCard);
}
Aggregations