@Test public void shouldContainAllSubSetMultipleKeyAndMultipleValuesForNottedKeyAndValue() { // given CaseInsensitiveRegexHashMap hashMap = hashMap( new NottableString[] {string("keyOne"), string("keyOneValue")}, new NottableString[] {not("keyTwo"), not("keyTwoValue")}, new NottableString[] { string("keyThree"), string("keyThreeValue"), string("keyThree_valueTwo") }); // then assertThat( hashMap.containsAll( hashMap( new NottableString[] {string("keyOne"), string("keyOneValue")}, new NottableString[] {string("notKeyTwo"), string("notKeyTwoValue")})), is(true)); // and then assertThat( hashMap.containsAll( hashMap( new NottableString[] {string("keyOne"), string("keyOneValue")}, new NottableString[] {not("keyTwo"), not("keyTwoValue")})), is(true)); }
@Test public void shouldContainAllExactMatchSingleKeyAndSingleValueForNottedKeyAndValue() { // given CaseInsensitiveRegexHashMap hashMap = hashMap(new NottableString[] {not("keyOne"), not("keyOneValue")}); // then assertThat( hashMap.containsAll( hashMap(new NottableString[] {string("notKeyOne"), string("notKeyOneValue")})), is(true)); // and then assertThat( hashMap.containsAll(hashMap(new NottableString[] {not("keyOne"), not("keyOneValue")})), is(true)); }
@Test public void shouldNotContainAllNotMatchSingleKeyAndValueSingleEntry() { // given CaseInsensitiveRegexHashMap hashMap = hashMap(new NottableString[] {not("keyOne"), not("keyOneValue")}); // then assertThat( hashMap.containsAll( hashMap(new NottableString[] {string("keyOne"), string("keyOneValue")})), is(false)); }
@Test public void shouldNotContainAllSubSetMultipleKeyForEmptyMap() { // given CaseInsensitiveRegexHashMap hashMap = hashMap(new NottableString[] {}); // then assertThat( hashMap.containsAll( hashMap( new NottableString[] {not("keyOne"), string("keyOneValue")}, new NottableString[] {string("keyTwo"), string("keyTwoValue")})), is(false)); }
@Test public void shouldNotContainAllNotMatchMultipleValuesMultipleEntries() { // given CaseInsensitiveRegexHashMap hashMap = hashMap( new NottableString[] {string("keyOne"), not("keyOneValue")}, new NottableString[] {string("keyTwo"), not("keyTwoValue")}, new NottableString[] { string("keyThree"), string("keyThreeValue"), string("keyThree_valueTwo") }); // then assertThat( hashMap.containsAll( hashMap( new NottableString[] {string("keyOne"), string("keyOneValue")}, new NottableString[] {string("keyTwo"), string("keyTwoValue")})), is(false)); assertThat( hashMap.containsAll(hashMap(new NottableString[] {string("keyTwo"), string("keyTwo.*")})), is(false)); }