コード例 #1
0
        public virtual void test_builder_openClose_wrongCloseKey()
        {
            ExplainMapBuilder builder = ExplainMap.builder();
            ExplainMapBuilder child   = builder.openListEntry(ExplainKey.LEGS);

            child.put(ExplainKey.ACCRUAL_DAYS, 2);
            assertThrows(() => child.closeListEntry(ExplainKey.PAYMENT_PERIODS), typeof(System.InvalidOperationException));
        }
コード例 #2
0
        public virtual void test_builder_openClose()
        {
            ExplainMapBuilder builder = ExplainMap.builder();
            ExplainMapBuilder child   = builder.openListEntry(ExplainKey.LEGS);

            child.put(ExplainKey.ACCRUAL_DAYS, 2);
            ExplainMapBuilder result = child.closeListEntry(ExplainKey.LEGS);
            ExplainMap        test   = result.build();

            assertEquals(test.Map.size(), 1);
            assertEquals(test.get(ExplainKey.LEGS).Present, true);
            assertEquals(test.get(ExplainKey.LEGS).get().size(), 1);
            assertEquals(test.get(ExplainKey.LEGS).get().get(0).get(ExplainKey.ACCRUAL_DAYS), 2);
        }