Skip to content

Commit

Permalink
More tests to check when is a valid input/output/func
Browse files Browse the repository at this point in the history
  • Loading branch information
fabriciofx committed Jun 28, 2017
1 parent c753ee9 commit e29d526
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/test/java/org/cactoos/FuncTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -50,4 +50,16 @@ public Object apply(final Object input) throws Exception {
}
).apply(null);
}

@Test
public void okForNoNulls() throws Exception {
new Func.NoNulls<>(
new Func<Object, Object>() {
@Override
public Object apply(final Object input) throws Exception {
return input;
}
}
).apply(new Object());
}
}
5 changes: 5 additions & 0 deletions src/test/java/org/cactoos/InputTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
package org.cactoos;

import java.io.IOException;
import org.cactoos.io.DeadInput;
import org.junit.Test;

/**
Expand All @@ -40,4 +41,8 @@ public void failForNullInput() throws IOException {
new Input.NoNulls(null).stream();
}

@Test
public void okForNoNullInput() throws IOException {
new Input.NoNulls(new DeadInput()).stream();
}
}
5 changes: 5 additions & 0 deletions src/test/java/org/cactoos/OutputTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
package org.cactoos;

import java.io.IOException;
import org.cactoos.io.DeadOutput;
import org.junit.Test;

/**
Expand All @@ -40,4 +41,8 @@ public void failForNullOutput() throws IOException {
new Output.NoNulls(null).stream();
}

@Test
public void okForNoNullOutput() throws IOException {
new Output.NoNulls(new DeadOutput()).stream();
}
}

0 comments on commit e29d526

Please sign in to comment.