package edu.chl.proton.model;



import org.junit.Test;

import java.io.BufferedReader;
import java.io.FileReader;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;

import static org.junit.Assert.assertTrue;

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

    @Test
    public void saveFileTest() throws IOException {
        File classUnderTest = new File("hej.txt");
        List<String> list = new ArrayList<>();
        for(int i = 0; i < 5; i++) {
            list.add("Line " + i);
        }
        classUnderTest.save(list);
        List<String> records = new ArrayList<>();
        try {
            BufferedReader reader = new BufferedReader(new FileReader(classUnderTest.getPath()));
            String line;
            while((line = reader.readLine()) != null) {
                records.add(line);
            }
            reader.close();
        } catch (Exception e) {}
        assertTrue("Instance of Workspace should not be null", classUnderTest != null);
        assertTrue("Instance of Workspace should not be null", list.equals(records));
    }
}
@@ -956,16 +956,17 @@
 n e) %7B%7D%0A
+%0A
         
@@ -977,37 +977,39 @@
 rtTrue(%22
-Instance of Workspace
+The file classUnderTest
  should 
@@ -1071,48 +1071,39 @@
 ue(%22
-Instance of Workspace should not be null
+list should be equal to records
 %22, l

Fix saveFileTest