Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions src/test/java/org/launchcode/techjobs/oo/AbstractTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -68,12 +68,12 @@ protected int getJobId(Job job) throws ClassNotFoundException, NoSuchMethodExcep
}

protected String getJobString (Job job) throws NoSuchMethodException, ClassNotFoundException, InvocationTargetException, IllegalAccessException, NoSuchFieldException {
return String.format("\nID: %d\n" +
"Name: %s\n" +
"Employer: %s\n" +
"Location: %s\n" +
"Position Type: %s\n" +
"Core Competency: %s\n", getJobId(job), getJobFieldString(job, "name", true), getJobFieldString(job, "employer", true), getJobFieldString(job, "location", true),
return String.format("%nID: %d%n" +
"Name: %s%n" +
"Employer: %s%n" +
"Location: %s%n" +
"Position Type: %s%n" +
"Core Competency: %s%n", getJobId(job), getJobFieldString(job, "name", true), getJobFieldString(job, "employer", true), getJobFieldString(job, "location", true),
getJobFieldString(job, "positionType", true), getJobFieldString(job, "coreCompetency", true));
}

Expand Down
10 changes: 4 additions & 6 deletions src/test/java/org/launchcode/techjobs/oo/TestTaskFive.java
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,7 @@
import java.lang.reflect.Method;

import static java.lang.System.lineSeparator;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.fail;
import static org.junit.Assert.*;

/**
* Created by LaunchCode
Expand All @@ -36,10 +35,9 @@ public void testTestToStringStartsAndEndsWithNewLineExists () throws ClassNotFou
@Test
public void testToStringStartsAndEndsWithNewLine() throws ClassNotFoundException, NoSuchMethodException, InvocationTargetException, InstantiationException, IllegalAccessException {
Job job = createJob("Web Developer", "LaunchCode", "StL", "Back-end developer", "Java");
String firstChar = String.valueOf(job.toString().charAt(0));
String lastChar = String.valueOf(job.toString().charAt(job.toString().length()-1));
assertEquals(firstChar, lineSeparator());
assertEquals(lastChar, lineSeparator());
String jobString = job.toString();
assertTrue(jobString.startsWith(lineSeparator()));
assertTrue(jobString.endsWith(lineSeparator()));
}

@Test
Expand Down