src/test/java/nl/bioinf/minorapplicationdesign/ontpillen/model/data_storage/content/ContentNodeTest.java
/**
     * Test checks if adding multiple content doesnt overwrite the older ones.
     */
Test checks if adding multiple content doesnt overwrite the older ones.
Test checks if adding multiple content doesnt overwrite the older ones .
@Test
    void addContent_addMultipleContents_CorrectContentTypes() {
        myContentNode.addContent(myContentLeaf);
        ContentLeaf contentToAdd = new ContentLeaf();
        contentToAdd.setContent(new ArrayList<>(Arrays.asList("test1", "test2", "test3")));
        contentToAdd.setContentType("LIST");
        myContentNode.addContent(contentToAdd);
        myContentNode.addContent(contentToAdd);
        ContentLeaf contentAsLeaf = (ContentLeaf) myContentNode.getContent().get(0);
        assertEquals("PARAGRAPH",  contentAsLeaf.contentType.name());
    }
@ Test void addContent_addMultipleContents_CorrectContentTypes ( ) { myContentNode . addContent ( myContentLeaf ) ; ContentLeaf contentToAdd = new ContentLeaf ( ) ; contentToAdd . setContent ( new ArrayList < > ( Arrays . asList ( "test1" , "test2" , "test3" ) ) ) ; contentToAdd . setContentType ( "LIST" ) ; myContentNode . addContent ( contentToAdd ) ; myContentNode . addContent ( contentToAdd ) ; ContentLeaf contentAsLeaf = ( ContentLeaf ) myContentNode . getContent ( ) . get ( 0 ) ; assertEquals ( "PARAGRAPH" , contentAsLeaf . contentType . name ( ) ) ; }
Test checks if adding multiple content doesnt overwrite the older ones.
Test checks if adding multiple content doesnt overwrite the older ones .