Пример #1
0
        public void Render_should_render_body_with_links()
        {
            _module.IsExistingCommitHash("b3e7944792", out _).Returns(x =>
            {
                x[1] = "b3e79447928051cfb3494c9c0ef1a1d0ecde56a8";
                return(true);
            });
            _module.IsExistingCommitHash("11119447928051cfb3494c9c0ef1a1d0ecde56a8", out _).Returns(x =>
            {
                x[1] = "11119447928051cfb3494c9c0ef1a1d0ecde56a8";
                return(true);
            });
            var data = new CommitData(ObjectId.Random(), ObjectId.Random(),
                                      new ReadOnlyCollection <string>(new List <string>()),
                                      "John Doe (Acme Inc) <*****@*****.**>", DateTime.UtcNow,
                                      "John Doe <*****@*****.**>", DateTime.UtcNow,
                                      "fix\n\nAllow cherry-picking multiple commits from FormBrowse menu\r\n\r\nThe ability to do so from the RevisionGrid context menu has been added in commit\r\nb3e7944792 and 11119447928051cfb3494c9c0ef1a1d0ecde56a8\r\n");

            var result = _rendererReal.Render(data, true);

            result.Should().Be("\nfix\n\nAllow cherry-picking multiple commits from FormBrowse menu\r\n\r\nThe ability to do so from the RevisionGrid context menu has been added in commit\r\n<a href='gitext://gotocommit/b3e79447928051cfb3494c9c0ef1a1d0ecde56a8'>b3e7944792</a> and <a href='gitext://gotocommit/11119447928051cfb3494c9c0ef1a1d0ecde56a8'>11119447928051cfb3494c9c0ef1a1d0ecde56a8</a>");
        }
        public void Render_should_render_body_with_links()
        {
            _module.TryResolvePartialCommitId("b3e7944792", out _).Returns(x =>
            {
                x[1] = ObjectId.Parse("b3e79447928051cfb3494c9c0ef1a1d0ecde56a8");
                return(true);
            });
            _module.TryResolvePartialCommitId("11119447928051cfb3494c9c0ef1a1d0ecde56a8", out _).Returns(x =>
            {
                x[1] = ObjectId.Parse("11119447928051cfb3494c9c0ef1a1d0ecde56a8");
                return(true);
            });

            CommitData data = new(ObjectId.Random(), ObjectId.Random(),
                                  Array.Empty <ObjectId>(),
                                  "John Doe (Acme Inc) <*****@*****.**>", DateTime.UtcNow,
                                  "John Doe <*****@*****.**>", DateTime.UtcNow,
                                  "fix\n\nAllow cherry-picking multiple commits from FormBrowse menu\r\n\r\nThe ability to do so from the RevisionGrid context menu has been added in commit\r\nb3e7944792 and 11119447928051cfb3494c9c0ef1a1d0ecde56a8\r\n");

            var result = _rendererReal.Render(data, true);

            result.Should().Be("fix\n\nAllow cherry-picking multiple commits from FormBrowse menu\r\n\r\nThe ability to do so from the RevisionGrid context menu has been added in commit\r\n<a href='gitext://gotocommit/b3e79447928051cfb3494c9c0ef1a1d0ecde56a8'>b3e7944792</a> and <a href='gitext://gotocommit/11119447928051cfb3494c9c0ef1a1d0ecde56a8'>11119447928051cfb3494c9c0ef1a1d0ecde56a8</a>");
        }
Пример #3
0
 public void Render_should_throw_if_data_null()
 {
     ((Action)(() => _renderer.Render(null, true))).Should().Throw <ArgumentNullException>();
 }