Example #1
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));
        }
Example #2
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);
        }