I have the following class and its constructor just the parts of the class needed to show for the question are shown:
public class TestFile {
private File file;
// constructor takes test file location as a string
public TestFile(String testFile){
file = new File(testFile);
}
public class TestFileTest {
@org.junit.Test
public void readfile(){
TestFileTest greaterthree = new TestFileTest("./filesfortests/greaterthree.txt");
assetEquals("more than 3 lines", 1, greaterthree.readfile());
}
}
TestFileTest( )
in TestFileTest cannot be applied
to
(java.lang.String)
This
TestFileTest greaterthree = new TestFileTest("./filesfortests/greaterthree.txt");
should be
TestFile greaterthree = new TestFile("./filesfortests/greaterthree.txt");
You get that error, because you selected the "Tester" to instantiate it (but it doesn't take a String
).