package seedu.ezdo.commons.util;


import static org.junit.Assert.assertEquals;

import java.io.File;

import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.ExpectedException;

public class FileUtilTest {

    @Rule
    public ExpectedException thrown = ExpectedException.none();

    @Test
    public void getPath() {

        // valid case
        assertEquals("folder" + File.separator + "sub-folder", FileUtil.getPath("folder/sub-folder"));

        // null parameter -> assertion failure
        thrown.expect(AssertionError.class);
        FileUtil.getPath(null);

        // no forwards slash -> assertion failure
        thrown.expect(AssertionError.class);
        FileUtil.getPath("folder");
    }

}

@@ -72,16 +72,97 @@
 tEquals;
+%0Aimport static org.junit.Assert.assertFalse;%0Aimport static org.mockito.Mockito.*;
 %0A%0Aimport
@@ -798,10 +798,222 @@
 %0A    %7D%0A%0A
+    @Test%0A    public void createFile_noExists_false() throws Exception %7B%0A        File mock = mock(File.class);%0A        when(mock.exists()).thenReturn(true);%0A        assertFalse(FileUtil.createFile(mock));%0A    %7D%0A%0A
 %7D%0A

Add tests to FileUtil