コード例 #1
0
 public void test_ofLongShort_withInfo() {
   SecurityPosition test =
       SecurityPosition.ofLongShort(POSITION_INFO, SECURITY_ID, LONG_QUANTITY, SHORT_QUANTITY);
   assertEquals(test.getInfo(), POSITION_INFO);
   assertEquals(test.getSecurityId(), SECURITY_ID);
   assertEquals(test.getLongQuantity(), LONG_QUANTITY);
   assertEquals(test.getShortQuantity(), SHORT_QUANTITY);
   assertEquals(test.getQuantity(), QUANTITY);
 }
コード例 #2
0
 public void test_ofLongShort_noInfo() {
   SecurityPosition test =
       SecurityPosition.ofLongShort(SECURITY_ID, LONG_QUANTITY, SHORT_QUANTITY);
   assertEquals(test.getInfo(), PositionInfo.empty());
   assertEquals(test.getSecurityId(), SECURITY_ID);
   assertEquals(test.getLongQuantity(), LONG_QUANTITY);
   assertEquals(test.getShortQuantity(), SHORT_QUANTITY);
   assertEquals(test.getQuantity(), QUANTITY);
 }