~ubuntu-branches/ubuntu/trusty/monodevelop/trusty-proposed

« back to all changes in this revision

Viewing changes to external/ngit/NGit.Test/NGit.Revplot/PlotCommitListTest.cs

  • Committer: Package Import Robot
  • Author(s): Jo Shields
  • Date: 2013-05-12 09:46:03 UTC
  • mto: This revision was merged to the branch mainline in revision 29.
  • Revision ID: package-import@ubuntu.com-20130512094603-mad323bzcxvmcam0
Tags: upstream-4.0.5+dfsg
ImportĀ upstreamĀ versionĀ 4.0.5+dfsg

Show diffs side-by-side

added added

removed removed

Lines of Context:
84
84
                                return this;
85
85
                        }
86
86
 
 
87
                        public virtual PlotCommitListTest.CommitListAssert NrOfPassingLanes(int lanes)
 
88
                        {
 
89
                                NUnit.Framework.Assert.AreEqual(lanes, this.current.passingLanes.Length, "Number of passing lanes of commit #"
 
90
                                         + (this.nextIndex - 1) + " not as expected.");
 
91
                                return this;
 
92
                        }
 
93
 
87
94
                        public virtual PlotCommitListTest.CommitListAssert Parents(params RevCommit[] parents
88
95
                                )
89
96
                        {
310
317
                        test.Commit(merge_fix).Parents().LanePos(3);
311
318
                        test.NoMoreCommits();
312
319
                }
 
320
 
 
321
                // test a history where a merge commit has two time the same parent
 
322
                /// <exception cref="System.Exception"></exception>
 
323
                [NUnit.Framework.Test]
 
324
                public virtual void TestDuplicateParents()
 
325
                {
 
326
                        RevCommit m1 = Commit();
 
327
                        RevCommit m2 = Commit(m1);
 
328
                        RevCommit m3 = Commit(m2, m2);
 
329
                        RevCommit s1 = Commit(m2);
 
330
                        RevCommit s2 = Commit(s1);
 
331
                        PlotWalk pw = new PlotWalk(db);
 
332
                        pw.MarkStart(pw.LookupCommit(m3));
 
333
                        pw.MarkStart(pw.LookupCommit(s2));
 
334
                        PlotCommitList<PlotLane> pcl = new PlotCommitList<PlotLane>();
 
335
                        pcl.Source(pw);
 
336
                        pcl.FillTo(int.MaxValue);
 
337
                        PlotCommitListTest.CommitListAssert test = new PlotCommitListTest.CommitListAssert
 
338
                                (this, pcl);
 
339
                        test.Commit(s2).NrOfPassingLanes(0);
 
340
                        test.Commit(s1).NrOfPassingLanes(0);
 
341
                        test.Commit(m3).NrOfPassingLanes(1);
 
342
                        test.Commit(m2).NrOfPassingLanes(0);
 
343
                        test.Commit(m1).NrOfPassingLanes(0);
 
344
                        test.NoMoreCommits();
 
345
                }
313
346
        }
314
347
}