public void CanUseExternalExtensionDirectly() { IMarkdownExtension mockExtension = Substitute.For <IMarkdownExtension>(); Markdown markdown = new Markdown().UseExtension(mockExtension); // When // ReSharper disable once ReturnValueOfPureMethodIsNotUsed markdown.Execute(new[] { new TestDocument(string.Empty) }, new TestExecutionContext()).ToList(); // Make sure to materialize the result list // Then // Setup will always be called during markdown pipeline setup. mockExtension.Received().Setup(Arg.Any <MarkdownPipelineBuilder>()); }