public void InsertAndContainsTest() { BSTree <string> treeString = new BSTree <string>(); treeString.Insert(new Node <string>("S")); var item1C = tree.Contains(item1); var item2C = tree.Contains(item3); var strC = treeString.Contains(new Node <string>("S")); var falseCon = tree.Contains(new Node <int>()); var falseNull = tree.Contains(null); Assert.IsTrue(strC); Assert.IsTrue(item1C); Assert.IsTrue(item2C); Assert.IsFalse(falseCon); Assert.IsFalse(falseNull); }
public void BSTreeContains() { Assert.IsTrue(BSTCountry.Contains(USA.Name)); Assert.IsTrue(BSTCountry.Contains(China.Name)); Assert.IsFalse(BSTCountry.Contains("Finland")); }