Esempio n. 1
0
        public void CommentWithPrefixAndProjectPrefixAndIssueNumber()
        {
            Modification[] mods = new Modification[1];
            mods[0]              = new Modification();
            mods[0].FolderName   = "/trunk";
            mods[0].FileName     = "nant.bat";
            mods[0].ChangeNumber = "3";
            mods[0].Comment      = "some random text CCNET-5000 and the issue description";

            RegExIssueTrackerUrlBuilder regexIssue = CreateBuilder();

            regexIssue.SetupModification(mods);

            Assert.AreEqual(ExpectedUrl, mods[0].IssueUrl);
        }
Esempio n. 2
0
        public void NoCommentAtAll()
        {
            Modification[] mods = new Modification[1];
            mods[0]              = new Modification();
            mods[0].FolderName   = "/trunk";
            mods[0].FileName     = "nant.bat";
            mods[0].ChangeNumber = "3";
            mods[0].Comment      = string.Empty;

            RegExIssueTrackerUrlBuilder regexIssue = CreateBuilder();

            regexIssue.SetupModification(mods);

            Assert.IsNull(mods[0].IssueUrl);
        }
Esempio n. 3
0
        public void CommentWithTextOnly()
        {
            Modification[] mods = new Modification[1];
            mods[0]              = new Modification();
            mods[0].FolderName   = "/trunk";
            mods[0].FileName     = "nant.bat";
            mods[0].ChangeNumber = "3";
            mods[0].Comment      = "bla blabla bla bla";

            RegExIssueTrackerUrlBuilder regexIssue = CreateBuilder();

            regexIssue.SetupModification(mods);

            Assert.IsNull(mods[0].IssueUrl);
        }
Esempio n. 4
0
        public void MultilineCommentFirstLineContainsBugIdNextContainLogMessage()
        {
            System.Text.StringBuilder commentBuilder = new System.Text.StringBuilder();

            commentBuilder.AppendLine("FS#1234");
            commentBuilder.AppendLine("fixed typo");

            Modification[] mods = new Modification[1];
            mods[0]              = new Modification();
            mods[0].FolderName   = "/trunk";
            mods[0].FileName     = "nant.bat";
            mods[0].ChangeNumber = "3";
            mods[0].Comment      = commentBuilder.ToString();


            RegExIssueTrackerUrlBuilder regexIssue = new RegExIssueTrackerUrlBuilder();

            regexIssue.Find    = @"FS#(\d+)";
            regexIssue.Replace = @"http://flyspray.internal/index.php?do=details&task_id=$1";

            regexIssue.SetupModification(mods);

            Assert.AreEqual("http://flyspray.internal/index.php?do=details&task_id=1234", mods[0].IssueUrl);
        }