public void CallTree_TryGetFirstItem_NullList()
        {
            List <CallTreeNode> list = null;

            CallTreeNode resultNode;
            bool         result = CallTree.TryGetFirstItem(list, out resultNode);

            result.Should().BeFalse();
        }
        public void CallTree_TryGetFirstItem_FirstNode()
        {
            List <CallTreeNode> list = new List <CallTreeNode>();

            list.Add(new CallTreeNode()
            {
                FilePath = Expected
            });
            list.Add(new CallTreeNode());
            list.Add(new CallTreeNode());

            CallTreeNode resultNode;
            bool         result = CallTree.TryGetFirstItem(list, out resultNode);

            result.Should().BeTrue();
            resultNode.FilePath.Should().Be(Expected);
        }
        public void CallTree_TryGetFirstItem_NoVisibleNodes()
        {
            List <CallTreeNode> list   = new List <CallTreeNode>();
            CallTreeNode        target = new CallTreeNode();

            list.Add(new CallTreeNode()
            {
                Visibility = Visibility.Collapsed
            });
            list.Add(new CallTreeNode()
            {
                Visibility = Visibility.Hidden
            });

            CallTreeNode resultNode;
            bool         result = CallTree.TryGetFirstItem(list, out resultNode);

            result.Should().BeFalse();
        }
        public void CallTree_TryGetFirstItem_SkipNonVisibleNodes()
        {
            List <CallTreeNode> list = new List <CallTreeNode>();

            list.Add(new CallTreeNode()
            {
                Visibility = Visibility.Collapsed
            });
            list.Add(new CallTreeNode()
            {
                Visibility = Visibility.Hidden
            });
            list.Add(new CallTreeNode()
            {
                FilePath = Expected
            });
            list.Add(new CallTreeNode());

            CallTreeNode resultNode;
            bool         result = CallTree.TryGetFirstItem(list, out resultNode);

            result.Should().BeTrue();
            resultNode.FilePath.Should().Be(Expected);
        }