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)); }
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); }