public void AddRange_TwoSameElementsAlternativeTraverse_ShouldThrowArgumentException() { var st = new SortedTree <int>(true); Assert.Throws <ArgumentException>(() => st.AddRange(new List <int> { 3, 23, 3, })); }
public void Add_OneElementAlternativeTraverse_ShouldReturnWhenTravers() { var st = new SortedTree <int>(true); st.Add(3); CollectionAssert.AreEqual(new List <int> { 3 }, st.Traverse()); }
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()); }
public void Remove_AddThreeElementsRemoveOne_ShouldRemoveElement() { var st = new SortedTree <int>(true); st.Add(2); st.Add(4); st.Add(1); st.Remove(1); CollectionAssert.AreEqual(new List <int> { 2, 4 }, st.Traverse()); }
public void Travers_EmptyListAlternativeTraverse_ShouldReturnEmptyCollection() { var st = new SortedTree <int>(true); CollectionAssert.AreEqual(new List <int>(), st.Traverse()); }
public void AddRange_NullPassedAsElements_ShouldThrowArgumentException() { var st = new SortedTree <int>(); Assert.Throws <ArgumentException>(() => st.AddRange(null)); }
public void AddRange_NullPassedAsElementsAlternativeTraverse_ShouldThrowArgumentException() { var st = new SortedTree <int>(true); Assert.Throws <ArgumentException>(() => st.AddRange(null)); }