I recently started to use Visual Studio Code for java development. I am having some problems with the test runner.
I can run main() in .java files without any issues, but the "run test" option does not show up in my JUnit test file. Also, no files show up in the Test runner side-bar.
This is the JUnit test file for a Student class.
import static org.junit.Assert.*;
import org.junit.After;
import org.junit.AfterClass;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Test;
import org.junit.Ignore;
class Student_test {
@Test
public void testGetName() {
Student john = "John Deer";
String expected = "John Deer";
String result = john.getName();
assertEquals(result, expected);
}
}
I use the Java Test Runner extension in VS Code: https://marketplace.visualstudio.com/items?itemName=vscjava.vscode-java-test
Does anyone know how I could get the test file to show the "run test" option in the file, or how I could find it in the side-bar?