java - How write a compound Hamcrest statement (with a logical "or" operation) -


how go writing following junit assert hamcrest?

asserttrue(var1 == 5 || var2 == 10); 

i can't use anyof() matcher wrapper because dont need multiple matchers, need multiple statements, 1 each variable var1 , var2

you write single hamcrest assertion turning variables single composite object:

assertthat(immutablelist.of(var1, var2),     either(contains(is(5), anything()))     .or(contains(anything(), is(10)))); 

i suggest not particularly easy understand, nor explain mean , why represents success.


Comments

Popular posts from this blog

commonjs - How to write a typescript definition file for a node module that exports a function? -

openid - Okta: Failed to get authorization code through API call -

ios - Change Storyboard View using Seague -