-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
c83ba24
commit f0fe681
Showing
11 changed files
with
156 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
package com.github.lombrozo.testnames; | ||
|
||
import java.util.Arrays; | ||
import java.util.Collection; | ||
|
||
@FunctionalInterface | ||
public interface Cases { | ||
|
||
Collection<TestCase> all(); | ||
|
||
static Cases correct() { | ||
return () -> Arrays.asList( | ||
new TestCase.FakeCase("removes"), | ||
new TestCase.FakeCase("creates") | ||
); | ||
} | ||
|
||
static Cases wrong(){ | ||
return () -> Arrays.asList( | ||
new TestCase.FakeCase("remove"), | ||
new TestCase.FakeCase("test") | ||
); | ||
} | ||
} |
33 changes: 33 additions & 0 deletions
33
src/main/java/com/github/lombrozo/testnames/JavaParserCase.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
package com.github.lombrozo.testnames; | ||
|
||
import java.nio.file.Path; | ||
import lombok.Data; | ||
|
||
@Data | ||
class JavaParserCase implements TestCase { | ||
|
||
private final String className; | ||
private final String name; | ||
private final Path path; | ||
|
||
JavaParserCase(final String className, final String name, final Path path) { | ||
this.className = className; | ||
this.name = name; | ||
this.path = path; | ||
} | ||
|
||
@Override | ||
public String className() { | ||
return this.className; | ||
} | ||
|
||
@Override | ||
public String name() { | ||
return this.name; | ||
} | ||
|
||
@Override | ||
public Path path() { | ||
return this.path; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
package com.github.lombrozo.testnames; | ||
|
||
import java.nio.file.Path; | ||
import java.nio.file.Paths; | ||
|
||
public interface TestCase { | ||
|
||
String className(); | ||
|
||
String name(); | ||
|
||
Path path(); | ||
|
||
|
||
class FakeCase implements TestCase { | ||
|
||
private final String className; | ||
private final String name; | ||
private final Path path; | ||
|
||
FakeCase(final String name) { | ||
this("FakeClass", name, Paths.get(".")); | ||
} | ||
|
||
FakeCase(final String className, final String name, final Path path) { | ||
this.className = className; | ||
this.name = name; | ||
this.path = path; | ||
} | ||
|
||
@Override | ||
public String className() { | ||
return className; | ||
} | ||
|
||
@Override | ||
public String name() { | ||
return name; | ||
} | ||
|
||
@Override | ||
public Path path() { | ||
return path; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,7 +2,7 @@ | |
|
||
import org.junit.jupiter.api.Test; | ||
|
||
class TestExample { | ||
class TestSimple { | ||
@Test | ||
void creates() { | ||
} | ||
|