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()); }