Exemplo n.º 1
0
        [Test] public void FilterListChange()
        {
            _nodeCollection.Add("!Item1");
            _nodeCollection.Add("Item2");

            MockFilter mockFilter = new MockFilter();

            _filters.Add(mockFilter);
            Assert.AreEqual(1, _nodeCollection.VisibleItemCount);
            _filters.Remove(mockFilter);
            Assert.AreEqual(2, _nodeCollection.VisibleItemCount);
        }
Exemplo n.º 2
0
        [Test] public void FilterRecursive()
        {
            MockFilter mockFilter = new MockFilter();

            _filters.Add(mockFilter);

            JetListViewNode node = _nodeCollection.Add("!Item1");

            _nodeCollection.Add("?Item2", node);
            node.Expanded = true;

            VerifyItems(_nodeCollection.VisibleItems.GetEnumerator() /* empty list */);
        }
Exemplo n.º 3
0
        [Test] public void FilterUpdate()
        {
            MockFilter mockFilter = new MockFilter();

            _filters.Add(mockFilter);

            _nodeCollection.Add("!Item1");
            _nodeCollection.Add("?Item2");

            VerifyItems(_nodeCollection.VisibleItems.GetEnumerator(), "?Item2");

            mockFilter.SetFilterString("?");
            VerifyItems(_nodeCollection.VisibleItems.GetEnumerator(), "!Item1");
        }
Exemplo n.º 4
0
        [Test] public void FilterUpdateItem()
        {
            MockFilter mockFilter = new MockFilter();

            _filters.Add(mockFilter);

            MockComparable cmp = new MockComparable("?Item2");

            cmp.SimpleToString = true;
            _nodeCollection.Add(cmp);
            VerifyItems(_nodeCollection.VisibleItems.GetEnumerator(), cmp);

            cmp.Value = "!Item1";
            _nodeCollection.Update(cmp);
            VerifyItems(_nodeCollection.VisibleItems.GetEnumerator() /* empty list */);
        }