public void GivenTwoNodesWithAbsorbedCommits_ThenReturnsExpectedTextForEdgeWithTheSecondNumberIncluded() { int absorbedCount1 = 2; int absorbedCount2 = 3; var absorbedCommits1 = Enumerable.Repeat(new CommitStub(), absorbedCount1).ToArray(); var absorbedCommits2 = Enumerable.Repeat(new CommitStub(), absorbedCount2).ToArray(); NodeStub node1 = new NodeStub(new CommitStub { Treeish = Treeish1 }) { AbsorbedParentCommits = absorbedCommits1 }; NodeStub node2 = new NodeStub(new CommitStub { Treeish = Treeish2 }) { AbsorbedParentCommits = absorbedCommits2 }; GraphTooltipHelper helper = new GraphTooltipHelper(); string result = helper.MakeEdgeTooltip(node1, node2); Assert.Equal($"{Treeish1} -> ({absorbedCount2} more commits), {Treeish2}", result); }
public void GivenNodeWithSameCommitter_ThenReturnsExpectedText() { CommitStub commit = CreateCommitWithAuthor(); NodeStub node = new NodeStub(commit); GraphTooltipHelper helper = new GraphTooltipHelper(); string result = helper.MakeNodeTooltip(node); Assert.Equal( $"{Treeish1} - {Message}" + $"{LineSeparator}{AuthorName} @ {_authorWhen}", result); }
public void GivenTwoSimpleNodes_ThenReturnsExpectedTextForEdge() { NodeStub node1 = new NodeStub(new CommitStub { Treeish = Treeish1 }); NodeStub node2 = new NodeStub(new CommitStub { Treeish = Treeish2 }); GraphTooltipHelper helper = new GraphTooltipHelper(); string result = helper.MakeEdgeTooltip(node1, node2); Assert.Equal($"{Treeish1} -> {Treeish2}", result); }
public void GivenNodeWithDifferentCommitter_ThenReturnsExpectedText() { CommitStub commit = CreateCommitWithAuthor(); SignatureStub committer = new SignatureStub { Name = CommitterName, EMail = CommitterEMail, When = _committerWhen }; commit.Committer = committer; NodeStub node = new NodeStub(commit); GraphTooltipHelper helper = new GraphTooltipHelper(); string result = helper.MakeNodeTooltip(node); Assert.Equal( $"{Treeish1} - {Message}" + $"{LineSeparator}{AuthorName} @ {_authorWhen}" + $"{LineSeparator}Committed by: {CommitterName} @ {_committerWhen}", result); }