From c1e9f2de6a27541778f7a06e2015c5e80c0b942f Mon Sep 17 00:00:00 2001 From: Clint Rutkas Date: Tue, 22 Sep 2020 09:14:42 -0700 Subject: [PATCH] FxCop enabled (#6758) --- .../HTMLParsingExtensionTest.cs | 13 +++++++------ .../MarkdownPreviewHandlerTest.cs | 12 ++++++------ .../UnitTests-MarkdownPreviewHandler.csproj | 5 +++++ 3 files changed, 18 insertions(+), 12 deletions(-) diff --git a/src/modules/previewpane/PreviewPaneUnitTests/HTMLParsingExtensionTest.cs b/src/modules/previewpane/PreviewPaneUnitTests/HTMLParsingExtensionTest.cs index 1421d0e776..f632d988fa 100644 --- a/src/modules/previewpane/PreviewPaneUnitTests/HTMLParsingExtensionTest.cs +++ b/src/modules/previewpane/PreviewPaneUnitTests/HTMLParsingExtensionTest.cs @@ -11,15 +11,16 @@ namespace PreviewPaneUnitTests [TestClass] public class HTMLParsingExtensionTest { - private MarkdownPipeline BuidPipeline(IMarkdownExtension extension) + private static MarkdownPipeline BuidPipeline(IMarkdownExtension extension) { MarkdownPipelineBuilder pipelineBuilder = new MarkdownPipelineBuilder().UseAdvancedExtensions(); pipelineBuilder.Extensions.Add(extension); + return pipelineBuilder.Build(); } [TestMethod] - public void Extension_UpdatesTablesClass_WhenUsed() + public void ExtensionUpdatesTablesClassWhenUsed() { // Arrange string mdString = "| A | B |\n| -- | -- | "; @@ -34,7 +35,7 @@ namespace PreviewPaneUnitTests } [TestMethod] - public void Extension_UpdatesBlockQuotesClass_WhenUsed() + public void ExtensionUpdatesBlockQuotesClassWhenUsed() { // Arrange string mdString = "> Blockquotes."; @@ -49,7 +50,7 @@ namespace PreviewPaneUnitTests } [TestMethod] - public void Extension_UpdatesFigureClassAndBlocksRelativeUrl_WhenUsed() + public void ExtensionUpdatesFigureClassAndBlocksRelativeUrlWhenUsed() { // arrange string mdString = "![text](a.jpg \"Figure\")"; @@ -64,7 +65,7 @@ namespace PreviewPaneUnitTests } [TestMethod] - public void Extension_AddsClassToFigureCaption_WhenUsed() + public void ExtensionAddsClassToFigureCaptionWhenUsed() { // arrange string mdString = "^^^ This is a caption"; @@ -79,7 +80,7 @@ namespace PreviewPaneUnitTests } [TestMethod] - public void Extension_RemovesExternalImageUrlAndMakeCallback_WhenUsed() + public void ExtensionRemovesExternalImageUrlAndMakeCallbackWhenUsed() { // arrange int count = 0; diff --git a/src/modules/previewpane/PreviewPaneUnitTests/MarkdownPreviewHandlerTest.cs b/src/modules/previewpane/PreviewPaneUnitTests/MarkdownPreviewHandlerTest.cs index 9e0db75cd3..1efed2aa50 100644 --- a/src/modules/previewpane/PreviewPaneUnitTests/MarkdownPreviewHandlerTest.cs +++ b/src/modules/previewpane/PreviewPaneUnitTests/MarkdownPreviewHandlerTest.cs @@ -14,7 +14,7 @@ namespace PreviewPaneUnitTests public class MarkdownPreviewHandlerTest { [TestMethod] - public void MarkdownPreviewHandlerControl__AddsBrowserToForm_WhenDoPreviewIsCalled() + public void MarkdownPreviewHandlerControlAddsBrowserToFormWhenDoPreviewIsCalled() { // Arrange using (var markdownPreviewHandlerControl = new MarkdownPreviewHandlerControl()) @@ -29,7 +29,7 @@ namespace PreviewPaneUnitTests } [TestMethod] - public void MarkdownPreviewHandlerControl__AddsInfoBarToFormIfExternalImageLinkPresent_WhenDoPreviewIsCalled() + public void MarkdownPreviewHandlerControlAddsInfoBarToFormIfExternalImageLinkPresentWhenDoPreviewIsCalled() { // Arrange using (var markdownPreviewHandlerControl = new MarkdownPreviewHandlerControl()) @@ -44,7 +44,7 @@ namespace PreviewPaneUnitTests } [TestMethod] - public void MarkdownPreviewHandlerControl__AddsInfoBarToFormIfHTMLImageTagIsPresent_WhenDoPreviewIsCalled() + public void MarkdownPreviewHandlerControlAddsInfoBarToFormIfHTMLImageTagIsPresentWhenDoPreviewIsCalled() { // Arrange using (var markdownPreviewHandlerControl = new MarkdownPreviewHandlerControl()) @@ -59,7 +59,7 @@ namespace PreviewPaneUnitTests } [TestMethod] - public void MarkdownPreviewHandlerControl__DoesNotAddInfoBarToFormIfExternalImageLinkNotPresent_WhenDoPreviewIsCalled() + public void MarkdownPreviewHandlerControlDoesNotAddInfoBarToFormIfExternalImageLinkNotPresentWhenDoPreviewIsCalled() { // Arrange using (var markdownPreviewHandlerControl = new MarkdownPreviewHandlerControl()) @@ -74,7 +74,7 @@ namespace PreviewPaneUnitTests } [TestMethod] - public void MarkdownPreviewHandlerControl__UpdatesWebBrowserSettings_WhenDoPreviewIsCalled() + public void MarkdownPreviewHandlerControlUpdatesWebBrowserSettingsWhenDoPreviewIsCalled() { // Arrange using (var markdownPreviewHandlerControl = new MarkdownPreviewHandlerControl()) @@ -94,7 +94,7 @@ namespace PreviewPaneUnitTests } [TestMethod] - public void MarkdownPreviewHandlerControl__UpdateInfobarSettings_WhenDoPreviewIsCalled() + public void MarkdownPreviewHandlerControlUpdateInfobarSettingsWhenDoPreviewIsCalled() { // Arrange using (var markdownPreviewHandlerControl = new MarkdownPreviewHandlerControl()) diff --git a/src/modules/previewpane/PreviewPaneUnitTests/UnitTests-MarkdownPreviewHandler.csproj b/src/modules/previewpane/PreviewPaneUnitTests/UnitTests-MarkdownPreviewHandler.csproj index 20f41dc70e..38420cddae 100644 --- a/src/modules/previewpane/PreviewPaneUnitTests/UnitTests-MarkdownPreviewHandler.csproj +++ b/src/modules/previewpane/PreviewPaneUnitTests/UnitTests-MarkdownPreviewHandler.csproj @@ -102,6 +102,11 @@ 0.21.1 + + 3.3.0 + runtime; build; native; contentfiles; analyzers; buildtransitive + all + 2.1.2