//------------------------------------------------------------------------- public virtual void test_withQuantity() { FixedCouponBondPosition @base = sut(); double quantity = 75343d; FixedCouponBondPosition computed = @base.withQuantity(quantity); FixedCouponBondPosition expected = FixedCouponBondPosition.builder().info(POSITION_INFO).product(PRODUCT).longQuantity(quantity).build(); assertEquals(computed, expected); }
public virtual void test_createPosition() { FixedCouponBondSecurity test = sut(); PositionInfo positionInfo = PositionInfo.empty(); FixedCouponBondPosition expectedPosition1 = FixedCouponBondPosition.builder().info(positionInfo).product(PRODUCT).longQuantity(100).build(); assertEquals(test.createPosition(positionInfo, 100, ReferenceData.empty()), expectedPosition1); FixedCouponBondPosition expectedPosition2 = FixedCouponBondPosition.builder().info(positionInfo).product(PRODUCT).longQuantity(100).shortQuantity(50).build(); assertEquals(test.createPosition(positionInfo, 100, 50, ReferenceData.empty()), expectedPosition2); }
internal static FixedCouponBondPosition sut2() { return(FixedCouponBondPosition.builder().info(POSITION_INFO2).product(PRODUCT2).longQuantity(100).shortQuantity(50).build()); }
//------------------------------------------------------------------------- internal static FixedCouponBondPosition sut() { return(FixedCouponBondPosition.builder().info(POSITION_INFO).product(PRODUCT).longQuantity(QUANTITY).build()); }