You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
but some valid assertions directly on the map seem to be:
ASSERT.that(map).hasKey("foo").withValue("bar");
This is similar to the hasField("foo").withValue("bar"); pattern used in Subject itself, and it makes sense here.
AS to the others, it's sort of cute, but I'm just not sure it's worth it. Now the same thing can be said about all subject methods, and you can represent any of these propositions with assertTrue(somePredicate) in theory, so maybe I'm being too conservative here. I just feel like it doesn't add anything, where hasKey().withValue() seems to.
Some potential assertions:
void isEmpty();
IntegerSubject size();
CollectionSubject keys();
CollectionSubject values();
MapSubject contains(key, value);
That way, I can do:
ASSERT.that(map).size().isEqualTo(10);
ASSERT.that(map).keys().hasAnyOrder(a, b);
ASSERT.that(map)
.contains(key1, value1)
.contains(key2, value2)
The text was updated successfully, but these errors were encountered: