public void CallTree_TryGetLastItem_NullList() { List <CallTreeNode> list = null; CallTreeNode resultNode; bool result = CallTree.TryGetLastItem(list, out resultNode); result.Should().BeFalse(); }
public void CallTree_TryGetLastItem_LastNode() { List <CallTreeNode> list = new List <CallTreeNode>(); list.Add(new CallTreeNode()); list.Add(new CallTreeNode()); list.Add(new CallTreeNode() { FilePath = Expected }); CallTreeNode resultNode; bool result = CallTree.TryGetLastItem(list, out resultNode); result.Should().BeTrue(); resultNode.FilePath.Should().Be(Expected); }
public void CallTree_TryGetLastItem_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.TryGetLastItem(list, out resultNode); result.Should().BeFalse(); }
public void CallTree_TryGetLastItem_SkipNonVisibleNodes() { List <CallTreeNode> list = new List <CallTreeNode>(); list.Add(new CallTreeNode()); list.Add(new CallTreeNode() { FilePath = Expected }); list.Add(new CallTreeNode() { Visibility = Visibility.Collapsed }); list.Add(new CallTreeNode() { Visibility = Visibility.Hidden }); CallTreeNode resultNode; bool result = CallTree.TryGetLastItem(list, out resultNode); result.Should().BeTrue(); resultNode.FilePath.Should().Be(Expected); }