में विपरीत के विपरीत क्या है?हैमक्रिस्ट
List<String> list = Arrays.asList("b", "a", "c");
// should fail, because "d" is not in the list
expectedInList = new String[]{"a","b", "c", "d"};
Assert.assertThat(list, Matchers.contains(expectedInList));
// should fail, because a IS in the list
shouldNotBeInList = Arrays.asList("a","e", "f", "d");
Assert.assertThat(list, _does_not_contains_any_of_(shouldNotBeInList)));
_does_not_contains_any_of_
क्या होना चाहिए?
तुम सिर्फ 'contains' विधि नकारना कर सकते हैं? यानी 'शामिल है (चाहिएनॉटबिनलिस्ट)' मैंने इसमें बहुत कुछ नहीं किया है, इसलिए मुझे यकीन नहीं है कि यह काम करेगा, लेकिन यह एक कोशिश के लायक है। –
@ माइकल पिकेट: नहीं (सभी तत्व शामिल हैं) = सभी तत्व नहीं हैं – pihentagy
क्या आप हैमक्रिस्ट का उपयोग कर रहे हैं? यदि ऐसा है, तो वाक्यविन्यास अधिक होना चाहिए! AnyOf (...)। मुझे लगता है, सिर्फ एपीआई को देखकर मैंने कभी भी हामिक्रस्ट का उपयोग नहीं किया है। –