Пример #1
0
        public void AddRangeShouldAddOnlyValuesThatAreNotInTheHashSetAlready()
        {
            //Arrange
            var customList = new CustomList <int>()
            {
                100, 43, 40, 10, 10, 60, 5
            };

            //Act
            hashset.AddRange(customList);
            int[] expectedResult = new[] { 10, 20, 30, 40, 50, 60, 100, 43, 5 };
            //Assert
            for (int i = 0; i < hashset.Count; i++)
            {
                Assert.AreEqual(true, hashset.Remove(expectedResult[i]));
                Assert.AreEqual(false, hashset.Remove(expectedResult[i]));
            }
        }