Search in sources :

Example 1 with Part

use of com.iluwatar.abstractdocument.domain.Part in project java-design-patterns by iluwatar.

the class DomainTest method shouldConstructPart.

@Test
public void shouldConstructPart() {
    Map<String, Object> partProperties = new HashMap<>();
    partProperties.put(HasType.PROPERTY, TEST_PART_TYPE);
    partProperties.put(HasModel.PROPERTY, TEST_PART_MODEL);
    partProperties.put(HasPrice.PROPERTY, TEST_PART_PRICE);
    Part part = new Part(partProperties);
    assertEquals(TEST_PART_TYPE, part.getType().get());
    assertEquals(TEST_PART_MODEL, part.getModel().get());
    assertEquals(TEST_PART_PRICE, part.getPrice().get());
}
Also used : HashMap(java.util.HashMap) Part(com.iluwatar.abstractdocument.domain.Part) Test(org.junit.jupiter.api.Test)

Aggregations

Part (com.iluwatar.abstractdocument.domain.Part)1 HashMap (java.util.HashMap)1 Test (org.junit.jupiter.api.Test)1