Example #1
0
        public virtual void TestId()
        {
            string   msg = "A\nMessage\n";
            ObjectId id  = ChangeIdUtil.ComputeChangeId(treeId, parentId, p, q, msg);

            NUnit.Framework.Assert.AreEqual("73f3751208ac92cbb76f9a26ac4a0d9d472e381b", ObjectId
                                            .ToString(id));
        }
Example #2
0
        /// <exception cref="System.Exception"></exception>
        private string Call(string body, bool replaceExisting)
        {
            ObjectId computeChangeId = ChangeIdUtil.ComputeChangeId(treeId1, parentId1, author
                                                                    , committer, body);

            if (computeChangeId == null)
            {
                return(body);
            }
            return(ChangeIdUtil.InsertId(body, computeChangeId, replaceExisting));
        }
Example #3
0
 public virtual void TestClean()
 {
     NUnit.Framework.Assert.AreEqual("hej", ChangeIdUtil.Clean("hej\n\n"));
     NUnit.Framework.Assert.AreEqual("hej\n\nsan", ChangeIdUtil.Clean("hej\n\nsan\n\n"
                                                                      ));
     NUnit.Framework.Assert.AreEqual("hej\nsan", ChangeIdUtil.Clean("hej\n#men\nsan\n\n#men"
                                                                    ));
     NUnit.Framework.Assert.AreEqual("hej\nsan", ChangeIdUtil.Clean("hej\nsan\n\n#men"
                                                                    ));
     NUnit.Framework.Assert.AreEqual("hej\nsan", ChangeIdUtil.Clean("#no\nhej\nsan\n\n#men"
                                                                    ));
     NUnit.Framework.Assert.AreEqual("hej\nsan", ChangeIdUtil.Clean("#no\nhej\nsan\nSigned-off-by: me \n#men"
                                                                    ));
 }