Exemplo n.º 1
0
        public void TestDictionarySetTryGetValues()
        {
            DictionarySet <int, int> dictionarySet = new DictionarySet <int, int>();
            HashSet <int>            hashSet;

            // HashSet should not exist in empty DictionarySet
            Assert.IsFalse(dictionarySet.TryGetValues(FOO, out hashSet), "Got HashSet for FOO in empty DictionarySet");
            // on first add, value should not exist
            Assert.IsTrue(dictionarySet.Add(FOO, BAR), "FOO/BAR existed upon adding to empty DictionarySet");
            // HashSet should exist now
            Assert.IsTrue(dictionarySet.TryGetValues(FOO, out hashSet), "Didn't get HashSet for FOO in DictionarySet after adding FOO/BAR");
        }