public void SynchronisedHashSetAddsUniqueWordToSet()
        {
            var set = new SynchronisedHashSet <string>();

            for (int i = 0; i < _words.Length; i++)
            {
                set.Add(_words[i]);
            }

            Assert.AreEqual(Number, set.Count);
        }
Beispiel #2
0
        public void SynchronisedHashSetDoesNotAddItemIfUnderlyingSetDoesContainItem()
        {
            var items = new List <string> {
                "Frodo", "Sam", "Merry", "Pippin"
            };

            using (var set = new SynchronisedHashSet <string>(items))
            {
                set.Add("Frodo");

                Assert.AreEqual(4, set.Count);
            }
        }