Example #1
0
        public void AddRange_TwoSameElementsAlternativeTraverse_ShouldThrowArgumentException()
        {
            var st = new SortedTree <int>(true);

            Assert.Throws <ArgumentException>(() => st.AddRange(new List <int> {
                3, 23, 3,
            }));
        }
Example #2
0
        public void AddRage_MultipleElementsAlternativeTraverse_ShouldSortWhenTravers()
        {
            var st = new SortedTree <int>(true);

            st.AddRange(new List <int> {
                3, 23, 52, 1, 44, 11, 9
            });

            CollectionAssert.AreEqual(new List <int> {
                1, 3, 9, 11, 23, 44, 52
            }, st.Traverse());
        }
Example #3
0
        public void AddRange_NullPassedAsElements_ShouldThrowArgumentException()
        {
            var st = new SortedTree <int>();

            Assert.Throws <ArgumentException>(() => st.AddRange(null));
        }
Example #4
0
        public void AddRange_NullPassedAsElementsAlternativeTraverse_ShouldThrowArgumentException()
        {
            var st = new SortedTree <int>(true);

            Assert.Throws <ArgumentException>(() => st.AddRange(null));
        }