Exemplo n.º 1
0
        public void RemoveAndDisposeAll(ushort offset, int n)
        {
            var tree = new Carambolas.Net.Channel.Inbound.Node.Tree <Node>();

            for (int i = 0; i < n; ++i)
            {
                var seq = new Protocol.Ordinal((ushort)(offset + i));
                Assert.True(tree.TryAdd(new Node()
                {
                    SequenceNumber = seq
                }));
                Assert.False(tree.IsEmpty);
            }

            tree.RemoveAndDisposeAll();
            Assert.True(tree.IsEmpty);
            Assert.Null(tree.First);
        }
Exemplo n.º 2
0
        public void RemoveAndDisposeAllFromEmptyTree()
        {
            var tree = new Carambolas.Net.Channel.Inbound.Node.Tree <Node>();

            tree.RemoveAndDisposeAll();
        }