//------------------------------------------------------------------------- public virtual void coverage() { SwaptionSurfaceExpirySimpleMoneynessParameterMetadata test1 = SwaptionSurfaceExpirySimpleMoneynessParameterMetadata.of(TIME_TO_EXPIRY, SIMPLE_MONEYNESS); coverImmutableBean(test1); SwaptionSurfaceExpirySimpleMoneynessParameterMetadata test2 = SwaptionSurfaceExpirySimpleMoneynessParameterMetadata.of(2.5d, 60d, "(2.5, 60)"); coverBeanEquals(test1, test2); }
public virtual void test_of_noLabel() { SwaptionSurfaceExpirySimpleMoneynessParameterMetadata test = SwaptionSurfaceExpirySimpleMoneynessParameterMetadata.of(TIME_TO_EXPIRY, SIMPLE_MONEYNESS); assertEquals(test.Identifier, Pair.of(TIME_TO_EXPIRY, SIMPLE_MONEYNESS)); assertEquals(test.Label, Pair.of(TIME_TO_EXPIRY, SIMPLE_MONEYNESS).ToString()); assertEquals(test.SimpleMoneyness, SIMPLE_MONEYNESS); assertEquals(test.YearFraction, TIME_TO_EXPIRY); }
public virtual void test_of_withLabel() { string label = "(1.5Y, 0.25)"; SwaptionSurfaceExpirySimpleMoneynessParameterMetadata test = SwaptionSurfaceExpirySimpleMoneynessParameterMetadata.of(TIME_TO_EXPIRY, SIMPLE_MONEYNESS, label); assertEquals(test.Identifier, Pair.of(TIME_TO_EXPIRY, SIMPLE_MONEYNESS)); assertEquals(test.Label, label); assertEquals(test.SimpleMoneyness, SIMPLE_MONEYNESS); assertEquals(test.YearFraction, TIME_TO_EXPIRY); }
static NormalSwaptionExpirySimpleMoneynessVolatilitiesTest() { IList <SwaptionSurfaceExpirySimpleMoneynessParameterMetadata> list = new List <SwaptionSurfaceExpirySimpleMoneynessParameterMetadata>(); int nData = TIME.size(); for (int i = 0; i < nData; ++i) { SwaptionSurfaceExpirySimpleMoneynessParameterMetadata parameterMetadata = SwaptionSurfaceExpirySimpleMoneynessParameterMetadata.of(TIME.get(i), SIMPLE_MONEYNESS.get(i)); list.Add(parameterMetadata); } METADATA = Surfaces.normalVolatilityByExpirySimpleMoneyness("GOVT1-SWAPTION-VOL", ACT_365F, MoneynessType.RATES).withParameterMetadata(list); }
public virtual void test_serialization() { SwaptionSurfaceExpirySimpleMoneynessParameterMetadata test = SwaptionSurfaceExpirySimpleMoneynessParameterMetadata.of(TIME_TO_EXPIRY, SIMPLE_MONEYNESS); assertSerialization(test); }