public void NormalizeCiteLinkIndex_ThrowsBlockExceptionIfCiteLinkIndexIsInvalid(int dummyNumLinks, int dummyCiteLinkIndex)
        {
            // Arrange
            const int       dummyLineIndex       = 5;
            const int       dummyColumn          = 2;
            FlexiQuoteBlock dummyFlexiQuoteBlock = CreateFlexiQuoteBlock(citeLink: dummyCiteLinkIndex);

            dummyFlexiQuoteBlock.Column = dummyColumn;
            dummyFlexiQuoteBlock.Line   = dummyLineIndex;
            FlexiQuoteBlockFactory testSubject = CreateFlexiQuoteBlockFactory();

            // Act and assert
            BlockException result = Assert.Throws <BlockException>(() => testSubject.NormalizeCiteLinkIndex(dummyNumLinks, dummyFlexiQuoteBlock));

            Assert.Equal(string.Format(Strings.BlockException_BlockException_InvalidBlock,
                                       nameof(FlexiQuoteBlock),
                                       dummyLineIndex + 1,
                                       dummyColumn,
                                       Strings.BlockException_BlockException_ExceptionOccurredWhileProcessingBlock),
                         result.Message);
            var resultOptionsException = result.InnerException as OptionsException;

            Assert.IsType <OptionsException>(resultOptionsException);
            Assert.Equal(string.Format(Strings.OptionsException_OptionsException_InvalidOption,
                                       nameof(IFlexiQuoteBlockOptions.CiteLink),
                                       string.Format(Strings.OptionsException_FlexiQuoteBlockFactory_UnableToNormalize, dummyCiteLinkIndex, dummyNumLinks)),
                         resultOptionsException.Message);
        }
        public void ResolveBlockName_ResolvesBlockName(string dummyBlockName, string expectedResult)
        {
            // Arrange
            FlexiQuoteBlockFactory testSubject = CreateFlexiQuoteBlockFactory();

            // Act
            string result = testSubject.ResolveBlockName(dummyBlockName);

            // Assert
            Assert.Equal(expectedResult, result);
        }
        public void NormalizeCiteLinkIndex_NormalizesCiteLinkIndexIfSuccessful(int dummyNumLinks, int dummyCiteLinkIndex, int expectedCiteLinkIndex)
        {
            // Arrange
            FlexiQuoteBlock        dummyFlexiQuoteBlock = CreateFlexiQuoteBlock(citeLink: dummyCiteLinkIndex);
            FlexiQuoteBlockFactory testSubject          = CreateFlexiQuoteBlockFactory();

            // Act
            int result = testSubject.NormalizeCiteLinkIndex(dummyNumLinks, dummyFlexiQuoteBlock);

            // Assert
            Assert.Equal(expectedCiteLinkIndex, result);
        }
        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
        }