Skip to content

Commit

Permalink
Rename FuncApplies to IsApplicable #213
Browse files Browse the repository at this point in the history
  • Loading branch information
Olivier B. OURA committed Jan 11, 2021
1 parent b7408a3 commit fb9f621
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -39,14 +39,14 @@
* @since 0.2
*/
@SuppressWarnings("PMD.AvoidDuplicateLiterals")
public final class FuncApplies<X, Y> extends MatcherEnvelope<Func<X, Y>> {
public final class IsApplicable<X, Y> extends MatcherEnvelope<Func<X, Y>> {

/**
* Ctor.
* @param inpt Input for the function
* @param result The result expected
*/
public FuncApplies(final X inpt, final Y result) {
public IsApplicable(final X inpt, final Y result) {
this(inpt, new IsEqual<>(result));
}

Expand All @@ -55,7 +55,7 @@ public FuncApplies(final X inpt, final Y result) {
* @param input Input for the function
* @param mtr Matcher of the text
*/
public FuncApplies(final X input, final Matcher<Y> mtr) {
public IsApplicable(final X input, final Matcher<Y> mtr) {
super(
new MatcherOf<>(
func -> mtr.matches(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,19 +30,19 @@
import org.junit.Test;

/**
* Test case for {@link FuncApplies}.
* Test case for {@link IsApplicable}.
*
* @since 1.0
* @checkstyle JavadocMethodCheck (100 lines)
* @checkstyle MagicNumber (100 line)
*/
public final class FuncAppliesTest {
public final class IsApplicableTest {

@Test
public void matchFuncs() {
new Assertion<>(
"matches function that produces same output from the given input",
new FuncApplies<>(1, 1),
new IsApplicable<>(1, 1),
new Matches<>(x -> x)
).affirm();
}
Expand All @@ -52,7 +52,7 @@ public void mismatchFuncs() {
new Assertion<>(
// @checkstyle LineLength (1 line)
"does not match function that produces different output from the given input",
new FuncApplies<>(1, 1),
new IsApplicable<>(1, 1),
new IsNot<>(new Matches<>(x -> 3 * x))
).affirm();
}
Expand All @@ -61,7 +61,7 @@ public void mismatchFuncs() {
public void describesMismatch() {
new Assertion<>(
"describes mismatch",
new FuncApplies<>(1, 1),
new IsApplicable<>(1, 1),
new Mismatches<>(
x -> 3 * x,
"Func with <1>",
Expand Down

0 comments on commit fb9f621

Please sign in to comment.