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

« back to all changes in this revision

Viewing changes to external/ngit/NGit.Test/NGit.Api/ReflogCommandTest.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:
91
91
                                );
92
92
                        NUnit.Framework.Assert.AreEqual(reflogs[2].GetNewId(), commit1.Id);
93
93
                        NUnit.Framework.Assert.AreEqual(reflogs[2].GetOldId(), ObjectId.ZeroId);
 
94
                        NUnit.Framework.Assert.AreEqual(reflogs[1].GetComment(), "checkout: moving from master to b1"
 
95
                                );
94
96
                        NUnit.Framework.Assert.AreEqual(reflogs[1].GetNewId(), commit1.Id);
95
97
                        NUnit.Framework.Assert.AreEqual(reflogs[1].GetOldId(), commit1.Id);
96
98
                        NUnit.Framework.Assert.AreEqual(reflogs[0].GetComment(), "commit: Removed file");
112
114
                        NUnit.Framework.Assert.AreEqual(reflogs[0].GetComment(), "commit: Removed file");
113
115
                        NUnit.Framework.Assert.AreEqual(reflogs[0].GetNewId(), commit2.Id);
114
116
                        NUnit.Framework.Assert.AreEqual(reflogs[0].GetOldId(), commit1.Id);
 
117
                        NUnit.Framework.Assert.AreEqual(reflogs[1].GetComment(), "branch: Created from commit Initial commit"
 
118
                                );
115
119
                        NUnit.Framework.Assert.AreEqual(reflogs[1].GetNewId(), commit1.Id);
116
120
                        NUnit.Framework.Assert.AreEqual(reflogs[1].GetOldId(), ObjectId.ZeroId);
117
121
                }
 
122
 
 
123
                /// <summary>Test getting the reflog for an amend commit</summary>
 
124
                /// <exception cref="System.Exception">System.Exception</exception>
 
125
                [NUnit.Framework.Test]
 
126
                public virtual void TestAmendReflog()
 
127
                {
 
128
                        RevCommit commit2a = git.Commit().SetAmend(true).SetMessage("Deleted file").Call(
 
129
                                );
 
130
                        ICollection<ReflogEntry> reflog = git.Reflog().Call();
 
131
                        NUnit.Framework.Assert.IsNotNull(reflog);
 
132
                        NUnit.Framework.Assert.AreEqual(4, reflog.Count);
 
133
                        ReflogEntry[] reflogs = Sharpen.Collections.ToArray(reflog, new ReflogEntry[reflog
 
134
                                .Count]);
 
135
                        NUnit.Framework.Assert.AreEqual(reflogs[3].GetComment(), "commit: Initial commit"
 
136
                                );
 
137
                        NUnit.Framework.Assert.AreEqual(reflogs[3].GetNewId(), commit1.Id);
 
138
                        NUnit.Framework.Assert.AreEqual(reflogs[3].GetOldId(), ObjectId.ZeroId);
 
139
                        NUnit.Framework.Assert.AreEqual(reflogs[2].GetComment(), "checkout: moving from master to b1"
 
140
                                );
 
141
                        NUnit.Framework.Assert.AreEqual(reflogs[2].GetNewId(), commit1.Id);
 
142
                        NUnit.Framework.Assert.AreEqual(reflogs[2].GetOldId(), commit1.Id);
 
143
                        NUnit.Framework.Assert.AreEqual(reflogs[1].GetComment(), "commit: Removed file");
 
144
                        NUnit.Framework.Assert.AreEqual(reflogs[1].GetNewId(), commit2.Id);
 
145
                        NUnit.Framework.Assert.AreEqual(reflogs[1].GetOldId(), commit1.Id);
 
146
                        NUnit.Framework.Assert.AreEqual(reflogs[0].GetComment(), "commit (amend): Deleted file"
 
147
                                );
 
148
                        NUnit.Framework.Assert.AreEqual(reflogs[0].GetNewId(), commit2a.Id);
 
149
                        NUnit.Framework.Assert.AreEqual(reflogs[0].GetOldId(), commit2.Id);
 
150
                }
118
151
        }
119
152
}