コード例 #1
0
        public virtual void test_builder_withers()
        {
            TradeInfo test = TradeInfo.builder().counterparty(COUNTERPARTY).build().withId(ID).withAttribute(AttributeType.DESCRIPTION, "A");

            assertEquals(test.Id, ID);
            assertEquals(test.Counterparty, COUNTERPARTY);
            assertEquals(test.TradeDate, null);
            assertEquals(test.TradeTime, null);
            assertEquals(test.Zone, null);
            assertEquals(test.SettlementDate, null);
            assertEquals(test.AttributeTypes, ImmutableSet.of(AttributeType.DESCRIPTION));
            assertEquals(test.Attributes, ImmutableMap.of(AttributeType.DESCRIPTION, "A"));
            assertEquals(test.getAttribute(AttributeType.DESCRIPTION), "A");
            assertEquals(test.findAttribute(AttributeType.DESCRIPTION), ("A"));
        }
コード例 #2
0
        public virtual void test_builder()
        {
            TradeInfo test = TradeInfo.builder().counterparty(COUNTERPARTY).build();

            assertEquals(test.Id, null);
            assertEquals(test.Counterparty, COUNTERPARTY);
            assertEquals(test.TradeDate, null);
            assertEquals(test.TradeTime, null);
            assertEquals(test.Zone, null);
            assertEquals(test.SettlementDate, null);
            assertEquals(test.AttributeTypes, ImmutableSet.of());
            assertEquals(test.Attributes, ImmutableMap.of());
            assertThrowsIllegalArg(() => test.getAttribute(AttributeType.DESCRIPTION));
            assertEquals(test.findAttribute(AttributeType.DESCRIPTION), null);
        }