public virtual void TestParse_PublicParseMethod()
        {
            ObjectInserter.Formatter fmt = new ObjectInserter.Formatter();
            NGit.CommitBuilder       src = new NGit.CommitBuilder();
            src.TreeId    = fmt.IdFor(Constants.OBJ_TREE, new byte[] {  });
            src.Author    = author;
            src.Committer = committer;
            src.Message   = "Test commit\n\nThis is a test.\n";
            RevCommit p = RevCommit.Parse(src.Build());

            NUnit.Framework.Assert.AreEqual(src.TreeId, p.Tree);
            NUnit.Framework.Assert.AreEqual(0, p.ParentCount);
            NUnit.Framework.Assert.AreEqual(author, p.GetAuthorIdent());
            NUnit.Framework.Assert.AreEqual(committer, p.GetCommitterIdent());
            NUnit.Framework.Assert.AreEqual("Test commit", p.GetShortMessage());
            NUnit.Framework.Assert.AreEqual(src.Message, p.GetFullMessage());
        }
 /// <summary>Insert a single commit into the store, returning its unique name.</summary>
 /// <remarks>Insert a single commit into the store, returning its unique name.</remarks>
 /// <param name="builder">the builder containing the proposed commit's data.</param>
 /// <returns>the name of the commit object.</returns>
 /// <exception cref="System.IO.IOException">the object could not be stored.</exception>
 public ObjectId Insert(NGit.CommitBuilder builder)
 {
     return(Insert(Constants.OBJ_COMMIT, builder.Build()));
 }
예제 #3
0
 public virtual void TestParse_PublicParseMethod()
 {
     ObjectInserter.Formatter fmt = new ObjectInserter.Formatter();
     NGit.CommitBuilder src = new NGit.CommitBuilder();
     src.TreeId = fmt.IdFor(Constants.OBJ_TREE, new byte[] {  });
     src.Author = author;
     src.Committer = committer;
     src.Message = "Test commit\n\nThis is a test.\n";
     RevCommit p = RevCommit.Parse(src.Build());
     NUnit.Framework.Assert.AreEqual(src.TreeId, p.Tree);
     NUnit.Framework.Assert.AreEqual(0, p.ParentCount);
     NUnit.Framework.Assert.AreEqual(author, p.GetAuthorIdent());
     NUnit.Framework.Assert.AreEqual(committer, p.GetCommitterIdent());
     NUnit.Framework.Assert.AreEqual("Test commit", p.GetShortMessage());
     NUnit.Framework.Assert.AreEqual(src.Message, p.GetFullMessage());
 }