Skip to content

Commit

Permalink
(#927) Return back checks for keySet and values
Browse files Browse the repository at this point in the history
  • Loading branch information
vladhss committed Apr 16, 2019
1 parent 296a460 commit 9936cae
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/test/java/org/cactoos/map/BehavesAsMap.java
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
import org.hamcrest.MatcherAssert;
import org.hamcrest.TypeSafeMatcher;
import org.hamcrest.collection.IsMapContaining;
import org.hamcrest.core.IsCollectionContaining;
import org.hamcrest.core.IsEqual;

/**
Expand Down Expand Up @@ -70,6 +71,16 @@ public boolean matchesSafely(final Map<K, V> map) {
new IsEqual<>(this.value)
)
);
MatcherAssert.assertThat(
"Doesn't contain the key in #keySet()",
map.keySet(),
new IsCollectionContaining<>(new IsEqual<>(this.key))
);
MatcherAssert.assertThat(
"Doesn't contain the value in #values()",
map.values(),
new IsCollectionContaining<>(new IsEqual<>(this.value))
);
return true;
}

Expand Down

0 comments on commit 9936cae

Please sign in to comment.