Exemplo n.º 1
0
        //-------------------------------------------------------------------------
        public virtual void test_getValue_fxIdentity()
        {
            BuiltScenarioMarketData test = BuiltScenarioMarketData.builder(MarketDataBox.ofSingleValue(VAL_DATE)).build();

            assertEquals(test.ScenarioCount, 1);
            assertEquals(test.getValue(FxRateId.of(GBP, GBP)), MarketDataBox.ofSingleValue(FxRate.of(GBP, GBP, 1)));
        }
Exemplo n.º 2
0
        public virtual void test_getValue_withUnknownFailure()
        {
            BuiltScenarioMarketData test = BuiltScenarioMarketData.builder(MarketDataBox.ofSingleValue(VAL_DATE)).build();

            assertEquals(test.ValuationDate, MarketDataBox.ofSingleValue(VAL_DATE));
            assertEquals(test.containsValue(ID), false);
            assertEquals(test.Ids, ImmutableSet.of());
            assertEquals(test.findValue(ID), null);
            assertThrows(() => test.getValue(ID), typeof(MarketDataNotFoundException));
        }
Exemplo n.º 3
0
        public virtual void test_getValue_withKnownFailure()
        {
            string failureMessage        = "Something went wrong";
            BuiltScenarioMarketData test = BuiltScenarioMarketData.builder(MarketDataBox.ofSingleValue(VAL_DATE)).addResult(ID, Result.failure(FailureReason.ERROR, failureMessage)).build();

            assertEquals(test.ValuationDate, MarketDataBox.ofSingleValue(VAL_DATE));
            assertEquals(test.containsValue(ID), false);
            assertEquals(test.Ids, ImmutableSet.of());
            assertEquals(test.findValue(ID), null);
            assertThrows(() => test.getValue(ID), typeof(FailureException), failureMessage);
        }