Skip to content

Commit

Permalink
feat(#396): simplify the usage of Parameters
Browse files Browse the repository at this point in the history
  • Loading branch information
volodya-lombrozo committed Jul 29, 2024
1 parent c18bf7c commit b900b8a
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
8 changes: 8 additions & 0 deletions src/main/java/com/github/lombrozo/testnames/Cop.java
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,14 @@ final class Cop {
*/
private final Function<Suspect, Stream<Rule>> law;

/**
* Ctor.
* @param project The project to check.
*/
Cop(final Project project) {
this(project, new Parameters());
}

/**
* Ctor.
* @param proj The project to check.
Expand Down
6 changes: 2 additions & 4 deletions src/test/java/com/github/lombrozo/testnames/CopTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,7 @@ void checksSuccessfully() {
MatcherAssert.assertThat(
"Cop should not find any complaints.",
new Cop(
new Project.Fake(new ProductionClass.Fake(), new TestClass.Fake()),
new Parameters("maxNumberOfMocks", 0)
new Project.Fake(new ProductionClass.Fake(), new TestClass.Fake())
).inspection(),
Matchers.empty()
);
Expand All @@ -54,8 +53,7 @@ void checksWithComplaint() {
new Project.Fake(
new ProductionClass.Fake("CustomClass"),
new TestClass.Fake()
),
new Parameters("maxNumberOfMocks", 0)
)
).inspection(),
Matchers.hasSize(1)
);
Expand Down

0 comments on commit b900b8a

Please sign in to comment.