hamcrest - Test that either one thing holds or another in AssertJ -
I am in the process of converting some tests from Aspect J to Hetcrest. In the hamsterstest I use the following snippet:
assertThat (list, either (tags (S.E.E.E.T.s.s., .high)) or (In .sps, tags. Rda)));
That is, this list can be either, or how can I express it in AssertJ? The anyOf
function (i.e. any either , but this will be the second question) a position
; I have applied myself, but it seems like this is a normal matter.
No, this is an area better than Hamstrist assets.
To write the following argument:
set & lt; String & gt; GoodTags = NewLink Husheset ("OK", "Good"); Set up & lt; String & gt; BadTags = New Link HashSet ("Bad!", "Weird"); Set up & lt; String & gt; Tag = New Link HashSet ("OK", "Good", "OK", "?"); // is imported consistently // In any case, if one fulfills a situation (logical 'or'), then it succeeds. Tag (any included (good tag), contains (bad tag);
You need to make this condition:
Import static org.assertj.core.util.Lists.newArrayList; Importing java.util.Collection; Import org.assertj.core.api.Condition; Public category includes communication position increases & Lt; etarable & lt; string & gt; & gt; {private collection & lt; string & gt; collection; public container condition (iterable & lt; string & gt; value) {super ("included" + value); This.collection = NewA The listlist contains static content (archive & lt; string & gt; set) {Return new ContainsCondition;} @ Override Public Boolean matches (Iterable & Lt; String & gt; Actual) {Collection & lt ; String & gt; value = newAralyst (real); {string (Values.contains) returned false;} return true;}}}}
Maybe you are not what if you expect that your tag is in a collection End means that they are not in other
Comments
Post a Comment