//------------------------------------------------------------------------- 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_builder_resolved() { FixedCouponBondPosition test = sut(); assertEquals(test.Product, PRODUCT); assertEquals(test.Info, POSITION_INFO); assertEquals(test.LongQuantity, QUANTITY, 0d); assertEquals(test.ShortQuantity, 0d, 0d); assertEquals(test.Quantity, QUANTITY, 0d); assertEquals(test.withInfo(POSITION_INFO).Info, POSITION_INFO); assertEquals(test.withQuantity(129).Quantity, 129d, 0d); }