Exemplo n.º 1
0
        public void testEntrySet()
        {
            FastMap <String, String>          map    = buildTestFastMap();
            Set <Map.Entry <String, String> > actual = map.entrySet();
            IEnumerable <String> expectedKeys        = Sets.newHashSetWithExpectedSize(3);

            expectedKeys.add("foo");
            expectedKeys.add("baz");
            expectedKeys.add("alpha");
            IEnumerable <String> expectedValues = Sets.newHashSetWithExpectedSize(3);

            expectedValues.add("bar");
            expectedValues.add("bang");
            expectedValues.add("beta");
            Assert.AreEqual(3, actual.Count);
            for (Map.Entry <String, String> entry : actual)
            {
                expectedKeys.remove(entry.getKey());
                expectedValues.remove(entry.getValue());
            }
            Assert.AreEqual(0, expectedKeys.Count);
            Assert.AreEqual(0, expectedValues.Count);
        }