//------------------------------------------------------------------------- public virtual void test_withMetadata() { InterpolatedNodalCurve @base = InterpolatedNodalCurve.of(METADATA, XVALUES, YVALUES, INTERPOLATOR); InterpolatedNodalCurve test = @base.withMetadata(METADATA_ENTRIES); assertThat(test.Name).isEqualTo(CURVE_NAME); assertThat(test.ParameterCount).isEqualTo(SIZE); assertThat(test.Metadata).isEqualTo(METADATA_ENTRIES); assertThat(test.XValues).isEqualTo(XVALUES); assertThat(test.YValues).isEqualTo(YVALUES); }
public virtual void getter() { assertEquals(ADD_FIXED_CURVE.Metadata, METADATA_SPREAD); assertEquals(ADD_FIXED_CURVE.ParameterCount, XVALUES_SPREAD.size()); assertEquals(ADD_FIXED_CURVE.getParameter(0), ADD_FIXED_CURVE.SpreadCurve.getParameter(0)); assertEquals(ADD_FIXED_CURVE.getParameterMetadata(0), ADD_FIXED_CURVE.SpreadCurve.getParameterMetadata(0)); assertEquals(ADD_FIXED_CURVE.withParameter(0, 9d), AddFixedCurve.of(FIXED_CURVE, SPREAD_CURVE.withParameter(0, 9d))); assertEquals(ADD_FIXED_CURVE.withPerturbation((i, v, m) => v + 1d), AddFixedCurve.of(FIXED_CURVE, SPREAD_CURVE.withPerturbation((i, v, m) => v + 1d))); assertEquals(ADD_FIXED_CURVE.withMetadata(METADATA_FIXED), AddFixedCurve.of(FIXED_CURVE, SPREAD_CURVE.withMetadata(METADATA_FIXED))); }
public virtual void test_withMetadata_badSize() { InterpolatedNodalCurve @base = InterpolatedNodalCurve.of(METADATA, XVALUES, YVALUES, INTERPOLATOR); assertThrowsIllegalArg(() => @base.withMetadata(METADATA_ENTRIES2)); }