-
Notifications
You must be signed in to change notification settings - Fork 165
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
mehyil
committed
Aug 8, 2017
1 parent
49b4015
commit 8fb3218
Showing
1 changed file
with
26 additions
and
1 deletion.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -26,6 +26,7 @@ | |
import java.util.Collections; | ||
import java.util.LinkedList; | ||
import java.util.List; | ||
import org.cactoos.Proc; | ||
import org.cactoos.Scalar; | ||
import org.cactoos.ScalarHasValue; | ||
import org.cactoos.func.FuncOf; | ||
|
@@ -38,8 +39,8 @@ | |
|
||
/** | ||
* Test case for {@link And}. | ||
* | ||
* @author Vseslav Sekorin ([email protected]) | ||
* @author Mehmet Yildirim ([email protected]) | ||
* @version $Id$ | ||
* @since 0.8 | ||
* @checkstyle JavadocMethodCheck (500 lines) | ||
|
@@ -139,4 +140,28 @@ public void iteratesEmptyList() { | |
); | ||
} | ||
|
||
@Test | ||
public void testProc() throws Exception { | ||
final List<Integer> list = new LinkedList<>(); | ||
new And( | ||
(Proc<Integer>) list::add, | ||
1, 1 | ||
).value(); | ||
MatcherAssert.assertThat( | ||
list.size(), | ||
Matchers.equalTo(2) | ||
); | ||
} | ||
|
||
@Test | ||
public void testFunc() throws Exception { | ||
MatcherAssert.assertThat( | ||
new And( | ||
input -> input > 0, | ||
1, -1, 0 | ||
).value(), | ||
Matchers.equalTo(false) | ||
); | ||
} | ||
|
||
} |