FxCop enabled (#6758)

This commit is contained in:
Clint Rutkas 2020-09-22 09:14:42 -07:00 committed by GitHub
parent 55b36d44fa
commit c1e9f2de6a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 18 additions and 12 deletions

View File

@ -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;

View File

@ -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())

View File

@ -102,6 +102,11 @@
<PackageReference Include="Markdig.Signed">
<Version>0.21.1</Version>
</PackageReference>
<PackageReference Include="Microsoft.CodeAnalysis.FxCopAnalyzers">
<Version>3.3.0</Version>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<PackageReference Include="MSTest.TestAdapter">
<Version>2.1.2</Version>
</PackageReference>