-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'idafixtest' into 'master'
Idafixtest See merge request tdt4140-2018/02!50
- Loading branch information
Showing
7 changed files
with
75 additions
and
42 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
32 changes: 32 additions & 0 deletions
32
tdt4140-gr1802/app.core/src/test/java/tdt4140/gr1802/app/core/CSVsleepTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
package tdt4140.gr1802.app.core; | ||
|
||
import java.net.URL; | ||
import java.util.ArrayList; | ||
import java.util.List; | ||
import static org.junit.Assert.*; | ||
|
||
import org.junit.Test; | ||
|
||
|
||
public class CSVsleepTest { | ||
|
||
@Test | ||
public void getSleepDataTest() { | ||
// Load data from file | ||
URL url = this.getClass().getResource("sleepdata-csvtest.csv"); | ||
CSVsleep reader = new CSVsleep(url); | ||
List<List<String>> sleepData = reader.getSleepData(); | ||
|
||
// Make list with correct answer | ||
List<String> correct = new ArrayList<>(); | ||
correct.add("2016-11-30"); | ||
correct.add("63"); | ||
correct.add("6:09"); | ||
List<List<String>> correctList = new ArrayList<>(); | ||
correctList.add(correct); | ||
|
||
// Check if getSleepData-method returns correct | ||
assertEquals(sleepData, correctList); | ||
} | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 2 additions & 0 deletions
2
tdt4140-gr1802/app.core/src/test/resources/tdt4140/gr1802/app/core/sleepdata-csvtest.csv
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters