Skip to content

Commit

Permalink
Create toStringTest
Browse files Browse the repository at this point in the history
  • Loading branch information
nihas101 committed Mar 8, 2018
1 parent fa4c392 commit 4c47ec6
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ public void run() {
cycles = 0;
}

private void setupSoundTimer(){
private void setupSoundTimer() {
Instrument[] instruments = synthesizer.getDefaultSoundbank().getInstruments();
MidiChannel midiChannel = synthesizer.getChannels()[0];
synthesizer.loadInstrument(instruments[0]);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,16 @@ public void getMemory() {
assertEquals(false, aBoolean);
}

@Test
public void toStringTest() {
String zero = "0";
ScreenMemory screenMemory = new ScreenMemory();
String[] screenMemoryStrings = screenMemory.toString().trim().split("\\s+");

for (String screenMemoryString : screenMemoryStrings)
assertEquals(zero, screenMemoryString.trim());
}

@Test
public void read() {
ScreenMemory screenMemory = new ScreenMemory();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,12 @@ private File createSaveFile() throws IOException {
}

@Test
public void readStateFileError(){
public void readStateFileError() {
File file = new File("src/test/resources/doesNotExist");
SaveStateHandler saveStateHandler = new SaveStateHandler();
try{
try {
saveStateHandler.readState(file);
}catch (FailedReadingStateException exception){
} catch (FailedReadingStateException exception) {
return;
}

Expand Down

0 comments on commit 4c47ec6

Please sign in to comment.