public void ReplacePageLinks_Should_Rename_Title_Inside_Creole_Markup_Block()
        {
            // Arrange
            CreoleParser parser = new CreoleParser(_applicationSettings, _siteSettings);
            MarkupLinkUpdater updater = new MarkupLinkUpdater(parser);

            string text = @"//here is a nice **[[the internal wiki page title|the link text]]** and//
                            another one: *here is a nice [[the internal wiki page title|the link text]] and
                            *a different one: here is a nice [[different title|the link text]]";

            string expectedMarkup = @"//here is a nice **[[buy stuff online|the link text]]** and//
                            another one: *here is a nice [[buy stuff online|the link text]] and
                            *a different one: here is a nice [[different title|the link text]]";

            // Act
            string actualMarkup = updater.ReplacePageLinks(text, "the internal wiki page title", "buy stuff online");

            // Assert
            Assert.That(actualMarkup, Is.EqualTo(expectedMarkup), actualMarkup);
        }
        public void ReplacePageLinks_Should_Rename_Title_Inside_Markdown_Block()
        {
            // Arrange
            MarkdownParser parser = new MarkdownParser();
            MarkupLinkUpdater updater = new MarkupLinkUpdater(parser);

            string text = @"here is a nice [the link text](the-internal-wiki-page-title) and
                            another one: here is a nice [the link text](the-internal-wiki-page-title) and
                            a different one: here is a nice [the link text](different-title)";

            string expectedMarkup = @"here is a nice [the link text](buy-stuff-online) and
                            another one: here is a nice [the link text](buy-stuff-online) and
                            a different one: here is a nice [the link text](different-title)";

            // Act
            string actualMarkup = updater.ReplacePageLinks(text, "the internal wiki page title", "buy stuff online");

            // Assert
            Assert.That(actualMarkup, Is.EqualTo(expectedMarkup), actualMarkup);
        }
        public void ReplacePageLinks_Should_Rename_Basic_Creole_Title()
        {
            // Arrange
            CreoleParser parser = new CreoleParser(_applicationSettings, _siteSettings);
            MarkupLinkUpdater updater = new MarkupLinkUpdater(parser);

            string text = "here is a nice [[the internal wiki page title|the link text]]";
            string expectedMarkup = "here is a nice [[buy stuff online|the link text]]";

            // Act
            string actualMarkup = updater.ReplacePageLinks(text, "the internal wiki page title", "buy stuff online");

            // Assert
            Assert.That(actualMarkup, Is.EqualTo(expectedMarkup), actualMarkup);
        }
        public void ReplacePageLinks_Should_Not_Rename_Title_That_Is_Not_Found_In_Markdown()
        {
            // Arrange
            MarkdownParser parser = new MarkdownParser();
            MarkupLinkUpdater updater = new MarkupLinkUpdater(parser);

            string text = @"*here* is a nice **[the link text](the-internal-wiki-page-title)** and
                            another one: *here is a nice [the link text](the-internal-wiki-page-title) and
                            a different one: *here is a nice [the link text](different-title)";

            // Act
            string actualMarkup = updater.ReplacePageLinks(text, "page title", "buy stuff online");

            // Assert
            Assert.That(actualMarkup, Is.EqualTo(text), actualMarkup);
        }
        public void ReplacePageLinks_Should_Not_Rename_Title_That_Is_Not_Found_In_Creole()
        {
            // Arrange
            CreoleParser parser = new CreoleParser(_applicationSettings, _siteSettings);
            MarkupLinkUpdater updater = new MarkupLinkUpdater(parser);

            string text = @"here is a nice [[the internal wiki page title|the link text]] and
                            another one: here is a nice [[the internal wiki page title|the link text]] and
                            a different one: here is a nice [[different title|the link text]]";

            // Act
            string actualMarkup = updater.ReplacePageLinks(text, "page title", "buy stuff online");

            // Assert
            Assert.That(actualMarkup, Is.EqualTo(text), actualMarkup);
        }
		public void replacepagelinks_should_rename_basic_markdown_title()
		{
			// Arrange
			MarkdownParser parser = new MarkdownParser();
			MarkupLinkUpdater updater = new MarkupLinkUpdater(parser);

			string text = "here is a nice [the link text](the-internal-wiki-page-title)";
			string expectedMarkup = "here is a nice [the link text](buy-stuff-online)";

			// Act
			string actualMarkup = updater.ReplacePageLinks(text, "the internal wiki page title", "buy stuff online");

			// Assert
			Assert.That(actualMarkup, Is.EqualTo(expectedMarkup), actualMarkup);
		}
		public void replacepagelinks_should_rename_multiple_creole_titles()
		{
			// Arrange
			CreoleParser parser = new CreoleParser(_applicationSettings, _siteSettings);
			MarkupLinkUpdater updater = new MarkupLinkUpdater(parser);

			string text = @"here is a nice [[the internal wiki page title|the link text]] and 
                            another one: here is a nice [[the internal wiki page title|the link text]] and 
							a different one: here is a nice [[different title|the link text]]";

			string expectedMarkup = @"here is a nice [[buy stuff online|the link text]] and 
                            another one: here is a nice [[buy stuff online|the link text]] and 
							a different one: here is a nice [[different title|the link text]]";

			// Act
			string actualMarkup = updater.ReplacePageLinks(text, "the internal wiki page title", "buy stuff online");

			// Assert
			Assert.That(actualMarkup, Is.EqualTo(expectedMarkup), actualMarkup);
		}