package edu.chl.proton.model;

import org.junit.Test;

import static org.junit.Assert.assertTrue;


/**
 * @author Stina Werme
 * Created by stinawerme on 11/05/17.
 */
public class FolderTest {

    @Test
    public void removeFolderTest() {

        Folder parent = new Folder("parent");
        Folder child = new Folder("child", parent);

        parent.removeFolder(child);

        assertTrue("The folder parent should not be null", parent != null);
        assertTrue("The folder child should not be null", child != null);
        assertTrue("ParentFolder should be null", child.getParentFolder() == null);
    }

    @Test
    public void removeFileTest() {

        File file = new File("file");
        Folder folder = new Folder("folder");

        folder.removeFile(file);

        assertTrue("The file file should not be null", file != null);
        assertTrue("The folder folder should not be null", folder != null);
        assertTrue("ParentFolder should be null", file.getParentFolder() == null);
    }
    }
}
@@ -1013,16 +1013,1101 @@
 );%0A    %7D
+%0A%0A    @Test%0A    public void addFileTest() %7B%0A%0A        Folder parent = new Folder(%22parent%22);%0A        File childFile = new File(%22childFile%22, parent);%0A        Folder newParent = new Folder(%22newParent%22);%0A%0A        newParent.addFile(childFile);%0A%0A        assertTrue(%22The folder parent should not be null%22, parent != null);%0A        assertTrue(%22The file childFile should not be null%22, childFile != null);%0A        assertTrue(%22The folder newParent should not be null%22, newParent != null);%0A        assertTrue(%22ParentFolder should be newParent%22, childFile.getParentFolder() == newParent);%0A    %7D%0A%0A    @Test%0A    public void addFolderTest() %7B%0A%0A        Folder one = new Folder(%22one%22);%0A        Folder two = new Folder(%22two%22, one);%0A        Folder three = new Folder(%22three%22);%0A%0A        two.addFolder(three);%0A%0A        assertTrue(%22The folder one should not be null%22, one != null);%0A        assertTrue(%22The folder two should not be null%22, two != null);%0A        assertTrue(%22The folder three should not be null%22, three != null);%0A        assertTrue(%22ParentFolder should be three%22, two.getParentFolder() == three);
 %0A    %7D%0A%7D

Add test for addFile and addFolder