コード例 #1
0
        public virtual void test_withUnknownFailure()
        {
            BuiltScenarioMarketData smd  = BuiltScenarioMarketData.builder(MarketDataBox.ofSingleValue(VAL_DATE)).build();
            BuiltMarketData         test = new BuiltMarketData(smd);

            assertEquals(test.ValuationDate, VAL_DATE);
            assertEquals(test.containsValue(ID), false);
            assertEquals(test.Ids, ImmutableSet.of());
            assertEquals(test.findValue(ID), null);
            assertThrows(() => test.getValue(ID), typeof(MarketDataNotFoundException));
        }
コード例 #2
0
        //-------------------------------------------------------------------------
        public virtual void test_withKnownFailure()
        {
            string failureMessage        = "Something went wrong";
            BuiltScenarioMarketData smd  = BuiltScenarioMarketData.builder(MarketDataBox.ofSingleValue(VAL_DATE)).addResult(ID, Result.failure(FailureReason.ERROR, failureMessage)).build();
            BuiltMarketData         test = new BuiltMarketData(smd);

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