Formatted all files to the same standard

This commit is contained in:
matthew
2014-10-08 13:42:12 +01:00
parent 53a2a8b150
commit 3da9ad5469
151 changed files with 952 additions and 870 deletions

View File

@ -6,27 +6,26 @@ import org.junit.Before;
import org.junit.Test;
/**
* This test case is responsible for testing our application
* by taking advantage of the Model-View-Controller architectural pattern.
* This test case is responsible for testing our application by taking advantage
* of the Model-View-Controller architectural pattern.
*/
public class FileSelectorPresenterTest {
/**
* The Presenter component.
*/
private FileSelectorPresenter presenter;
/**
* The View component, implemented this time as a Stub!!!
*/
private FileSelectorStub stub;
/**
* The Model component.
*/
private FileLoader loader;
/**
* Initializes the components of the test case.
*/
@ -37,18 +36,18 @@ public class FileSelectorPresenterTest {
presenter = new FileSelectorPresenter(this.stub);
presenter.setLoader(loader);
}
/**
* Tests if the Presenter was successfully connected with the View.
*/
@Test
public void wiring() {
presenter.start();
assertNotNull(stub.getPresenter());
assertTrue(stub.isOpened());
}
/**
* Tests if the name of the file changes.
*/
@ -56,45 +55,45 @@ public class FileSelectorPresenterTest {
public void updateFileNameToLoader() {
String EXPECTED_FILE = "Stamatis";
stub.setFileName(EXPECTED_FILE);
presenter.start();
presenter.fileNameChanged();
assertEquals(EXPECTED_FILE, loader.getFileName());
}
/**
* Tests if we receive a confirmation when we attempt to open a file
* that it's name is null or an empty string.
* Tests if we receive a confirmation when we attempt to open a file that
* it's name is null or an empty string.
*/
@Test
public void fileConfirmationWhenNameIsNull() {
stub.setFileName(null);
presenter.start();
presenter.fileNameChanged();
presenter.confirmed();
assertFalse(loader.isLoaded());
assertEquals(1, stub.getMessagesSent());
}
/**
* Tests if we receive a confirmation when we attempt to open a file
* that it doesn't exist.
* Tests if we receive a confirmation when we attempt to open a file that it
* doesn't exist.
*/
@Test
public void fileConfirmationWhenFileDoesNotExist() {
stub.setFileName("RandomName.txt");
presenter.start();
presenter.fileNameChanged();
presenter.confirmed();
assertFalse(loader.isLoaded());
assertEquals(1, stub.getMessagesSent());
}
/**
* Tests if we can open the file, when it exists.
*/
@ -104,11 +103,11 @@ public class FileSelectorPresenterTest {
presenter.start();
presenter.fileNameChanged();
presenter.confirmed();
assertTrue(loader.isLoaded());
assertTrue(stub.dataDisplayed());
}
/**
* Tests if the view closes after cancellation.
*/
@ -116,7 +115,7 @@ public class FileSelectorPresenterTest {
public void cancellation() {
presenter.start();
presenter.cancelled();
assertFalse(stub.isOpened());
}
}