Search in sources :

Example 1 with HasNameAndDataTypeCell

use of org.kie.workbench.common.dmn.client.editors.expressions.types.context.InformationItemCell.HasNameAndDataTypeCell in project kie-wb-common by kiegroup.

the class InformationItemCellInformationItemTest method testHasNameAndDataTypeCellGetHasTypeRefs.

@Test
public void testHasNameAndDataTypeCellGetHasTypeRefs() {
    final InformationItem informationItem = mock(InformationItem.class);
    final HasNameAndDataTypeCell hasNameAndDataTypeCell = HasNameAndDataTypeCell.wrap(informationItem);
    final HasTypeRef hasTypeRef1 = mock(HasTypeRef.class);
    final HasTypeRef hasTypeRef2 = mock(HasTypeRef.class);
    final List<HasTypeRef> expectedHasTypeRefs = asList(hasTypeRef1, hasTypeRef2);
    when(informationItem.getHasTypeRefs()).thenReturn(expectedHasTypeRefs);
    final List<HasTypeRef> actualHasTypeRefs = hasNameAndDataTypeCell.getHasTypeRefs();
    assertEquals(expectedHasTypeRefs, actualHasTypeRefs);
}
Also used : HasTypeRef(org.kie.workbench.common.dmn.api.definition.HasTypeRef) InformationItem(org.kie.workbench.common.dmn.api.definition.model.InformationItem) HasNameAndDataTypeCell(org.kie.workbench.common.dmn.client.editors.expressions.types.context.InformationItemCell.HasNameAndDataTypeCell) Test(org.junit.Test)

Example 2 with HasNameAndDataTypeCell

use of org.kie.workbench.common.dmn.client.editors.expressions.types.context.InformationItemCell.HasNameAndDataTypeCell in project kie-wb-common by kiegroup.

the class EditableNameAndDataTypeColumnTest method testEditSetTypeRefChanged.

@Test
public void testEditSetTypeRefChanged() {
    mockEditAction();
    final HasValueAndTypeRef<Name> hasValueAndTypeRef = hasNameAndDataTypeControlCaptor.getValue();
    final QName feel = new QName(DMNModelInstrumentedBase.Namespace.DMN.getUri(), "", DMNModelInstrumentedBase.Namespace.DMN.getPrefix());
    hasValueAndTypeRef.setTypeRef(feel);
    verify(setTypeRefConsumer).accept(eq((HasNameAndDataTypeCell) cell.getValue().getValue()), eq(feel));
}
Also used : QName(org.kie.workbench.common.dmn.api.property.dmn.QName) HasNameAndDataTypeCell(org.kie.workbench.common.dmn.client.editors.expressions.types.context.InformationItemCell.HasNameAndDataTypeCell) Name(org.kie.workbench.common.dmn.api.property.dmn.Name) HasName(org.kie.workbench.common.dmn.api.definition.HasName) QName(org.kie.workbench.common.dmn.api.property.dmn.QName) Test(org.junit.Test)

Aggregations

Test (org.junit.Test)2 HasNameAndDataTypeCell (org.kie.workbench.common.dmn.client.editors.expressions.types.context.InformationItemCell.HasNameAndDataTypeCell)2 HasName (org.kie.workbench.common.dmn.api.definition.HasName)1 HasTypeRef (org.kie.workbench.common.dmn.api.definition.HasTypeRef)1 InformationItem (org.kie.workbench.common.dmn.api.definition.model.InformationItem)1 Name (org.kie.workbench.common.dmn.api.property.dmn.Name)1 QName (org.kie.workbench.common.dmn.api.property.dmn.QName)1