public void FindItemShouldWorkCorrectly()
        {
            var hashSet = new HashedSet<string>();
            hashSet.Add("Ivan");

            Assert.AreEqual(hashSet.Find("Ivan"), "Ivan");
        }
        public void AddingItemShouldWorkCorrect()
        {
            var hashSet = new HashedSet<string>();
            hashSet.Add("Ivan");
            hashSet.Add("Asen");

            Assert.AreEqual(hashSet.Count, 2);
        }
        public void AddingItemShouldCountCorrectly()
        {
            var hashSet = new HashedSet<string>();
            hashSet.Add("Ivan");
            hashSet.Add("Ivan1");
            hashSet.Add("Ivan2");

            Assert.AreEqual(hashSet.Count, 3);
        }
        public void ClearShouldWorkCorrectly()
        {
            var hashSet = new HashedSet<string>();
            hashSet.Add("Ivan");
            hashSet.Add("Ivan1");
            hashSet.Add("Ivan2");
            hashSet.Clear();

            Assert.AreEqual(hashSet.Count, 0);
        }
        public void IntersectShouldWorkCorrectly()
        {
            var hashSet1 = new HashedSet<string>();
            hashSet1.Add("Ivan");
            hashSet1.Add("Ivan1");
            hashSet1.Add("Ivan2");

            var hashSet2 = new HashedSet<string>();
            hashSet2.Add("Asen");
            hashSet2.Add("Ivan1");
            hashSet2.Add("Asen1");

            hashSet1.Intersect(hashSet2);

            Assert.IsTrue(hashSet1.Find("Ivan1") == "Ivan1");
            Assert.AreEqual(hashSet1.Count, 1);
        }
 public void RemovingItemShouldWorkCorrectly()
 {
     var hashSet = new HashedSet<string>();
     hashSet.Add("Ivan");
     hashSet.Add("Ivan1");
     hashSet.Add("Ivan2");
     hashSet.Remove("Ivan");
     Assert.AreEqual(hashSet.Count, 2);
 }
 public void FindItemShouldThrowWhenKeyNotExists()
 {
     var hashSet = new HashedSet<string>();
     hashSet.Add("Ivan");
     hashSet.Find("Asen");
 }
 public void AddingItemShouldThrowWhenSameItemAded()
 {
     var hashSet = new HashedSet<string>();
     hashSet.Add("Ivan");
     hashSet.Add("Ivan");
 }