public void verify_PruneTrees_sets_IgnoreForReporting_flag_to_false_for_nodes_beyond_max_number()
        {
            IThreadProfilingProcessing service = new ThreadProfilingService(null, null, 3);
            ProfileNode node1 = new ProfileNode(new UIntPtr(10), 4, 2);

            service.AddNodeToPruningList(node1);

            ProfileNode node2 = new ProfileNode(new UIntPtr(12), 4, 6);

            service.AddNodeToPruningList(node2);

            ProfileNode node3 = new ProfileNode(new UIntPtr(16), 4, 1);

            service.AddNodeToPruningList(node3);

            ProfileNode node4 = new ProfileNode(new UIntPtr(16), 4, 3);

            service.AddNodeToPruningList(node4);

            service.SortPruningTree();

            Assert.IsFalse(((ProfileNode)service.PruningList[0]).IgnoreForReporting);
            Assert.IsFalse(((ProfileNode)service.PruningList[1]).IgnoreForReporting);
            Assert.IsFalse(((ProfileNode)service.PruningList[2]).IgnoreForReporting);
            Assert.IsTrue(((ProfileNode)service.PruningList[3]).IgnoreForReporting);
        }
        public void verify_PruneTrees_sorts_two_nodes_with_different_call_counts()
        {
            // Set the max aggregated nodes to 1 so that pruning is triggered.
            IThreadProfilingProcessing service = new ThreadProfilingService(null, null, 1);
            ProfileNode node1 = new ProfileNode(new UIntPtr(10), 4, 1);

            service.AddNodeToPruningList(node1);

            ProfileNode node2 = new ProfileNode(new UIntPtr(12), 5, 1);

            service.AddNodeToPruningList(node2);

            service.SortPruningTree();
            Assert.IsTrue(((ProfileNode)service.PruningList[0]).RunnableCount > ((ProfileNode)service.PruningList[1]).RunnableCount);
        }
        public void verify_PruneTrees_sorts_three_nodes_with_same_call_counts_but_different_depths()
        {
            // Set the max aggregated nodes to 1 so that pruning is triggered.
            IThreadProfilingProcessing service = new ThreadProfilingService(null, null, 1);
            ProfileNode node1 = new ProfileNode(new UIntPtr(10), 4, 2);

            service.AddNodeToPruningList(node1);

            ProfileNode node2 = new ProfileNode(new UIntPtr(12), 4, 6);

            service.AddNodeToPruningList(node2);

            ProfileNode node3 = new ProfileNode(new UIntPtr(16), 4, 1);

            service.AddNodeToPruningList(node3);

            service.SortPruningTree();
            Assert.IsTrue(
                (((ProfileNode)service.PruningList[0]).Depth < ((ProfileNode)service.PruningList[1]).Depth) &&
                (((ProfileNode)service.PruningList[1]).Depth < ((ProfileNode)service.PruningList[2]).Depth));
        }