public void ExtractCiteUrl_ExtractsCiteUrlIfSuccessful()
        {
            // Arrange
            const string dummyUrl = "dummyLink";
            var          dummyAuthorLinkInline = new LinkInline();
            var          dummyCiteLinkInline   = new LinkInline(dummyUrl, null);
            var          dummyContainerInline  = new ContainerInline();

            dummyContainerInline.
            AppendChild(dummyAuthorLinkInline).
            AppendChild(dummyCiteLinkInline);
            LeafBlock       dummyCitationBlock   = _mockRepository.Create <LeafBlock>(null).Object;
            InlineProcessor dummyInlineProcessor = MarkdigTypesFactory.CreateInlineProcessor();

            dummyInlineProcessor.ProcessInlineLeaf(dummyCitationBlock); // Sets InlineProcessor.Block to dummyCitationBlock
            dummyCitationBlock.Inline = dummyContainerInline;           // Replace container created in ProcessInlineLeaf
            FlexiQuoteBlock dummyFlexiQuoteBlock = CreateFlexiQuoteBlock();

            dummyFlexiQuoteBlock.Add(dummyCitationBlock);
            Mock <FlexiQuoteBlockFactory> mockTestSubject = CreateMockFlexiQuoteBlockFactory();

            mockTestSubject.Setup(m => m.NormalizeCiteLinkIndex(2, dummyFlexiQuoteBlock)).Returns(1);

            // Act
            mockTestSubject.Object.ExtractCiteUrl(dummyInlineProcessor, null);

            // Assert
            _mockRepository.VerifyAll();
            Assert.Equal(dummyUrl, dummyFlexiQuoteBlock.CiteUrl);
        }
        public void ExtractCiteUrl_DoesNothingIfThereAreNoLinkInlinesInCitationBlock()
        {
            // Arrange
            LeafBlock       dummyCitationBlock   = _mockRepository.Create <LeafBlock>(null).Object;
            InlineProcessor dummyInlineProcessor = MarkdigTypesFactory.CreateInlineProcessor();

            dummyInlineProcessor.ProcessInlineLeaf(dummyCitationBlock); // Sets InlineProcessor.Block to dummyCitationBlock
            FlexiQuoteBlockFactory testSubject = CreateFlexiQuoteBlockFactory();

            // Act and assert
            testSubject.ExtractCiteUrl(dummyInlineProcessor, null); // If this doesn't throw, we never attempted to extract cite URL
        }