//------------------------------------------------------------------------- public virtual void test_withQuantity() { OvernightFuturePosition @base = OvernightFuturePosition.builder().info(POSITION_INFO).product(PRODUCT).longQuantity(QUANTITY).build(); double quantity = 75343d; OvernightFuturePosition computed = @base.withQuantity(quantity); OvernightFuturePosition expected = OvernightFuturePosition.builder().info(POSITION_INFO).product(PRODUCT).longQuantity(quantity).build(); assertEquals(computed, expected); }
//------------------------------------------------------------------------- public virtual void test_builder() { OvernightFuturePosition test = OvernightFuturePosition.builder().info(POSITION_INFO).product(PRODUCT).longQuantity(QUANTITY).build(); 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); }