Ejemplo n.º 1
0
        public void Test_remove_null()
        {
            var bst = new MyBST <string>();

            bst.Add("abc");
            bst.Add("cd");
            bst.Add("qw");

            Assert.Throws <ArgumentNullException>(() => bst.Remove(null));
        }
Ejemplo n.º 2
0
        public void Test_add_existed_element()
        {
            var bst = new MyBST <char>();

            bst.Add('a');
            bst.Add('z');
            bst.Add('b');

            Assert.False(bst.Add('a'));
            Assert.True(bst.Add('A'));
        }
Ejemplo n.º 3
0
        public void Test_contains()
        {
            var bst = new MyBST <string>();

            bst.Add("abc");
            bst.Add("cd");
            bst.Add("qw");

            Assert.True(bst.Contains("cd"));
            Assert.False(bst.Contains("c"));
        }
Ejemplo n.º 4
0
        public void Test_add_null()
        {
            var bst = new MyBST <string>();

            Assert.Throws <ArgumentNullException>(() => bst.Add(null));
        }