enabling stylecop (#5885)

This commit is contained in:
Clint Rutkas
2020-08-11 16:35:58 -07:00
committed by GitHub
parent 1c77887629
commit a0832d3fb6
2 changed files with 21 additions and 4 deletions

View File

@@ -17,5 +17,19 @@
<ItemGroup>
<ProjectReference Include="..\Microsoft.Plugin.Uri\Microsoft.Plugin.Uri.csproj" />
</ItemGroup>
<ItemGroup>
<Compile Include="..\..\..\..\codeAnalysis\GlobalSuppressions.cs">
<Link>GlobalSuppressions.cs</Link>
</Compile>
<AdditionalFiles Include="..\..\..\..\codeAnalysis\StyleCop.json">
<Link>StyleCop.json</Link>
</AdditionalFiles>
</ItemGroup>
<ItemGroup>
<PackageReference Include="StyleCop.Analyzers">
<Version>1.1.118</Version>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
</ItemGroup>
</Project>

View File

@@ -1,3 +1,7 @@
// Copyright (c) Microsoft Corporation
// The Microsoft Corporation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
using Microsoft.Plugin.Uri.UriHelper;
using Microsoft.VisualStudio.TestPlatform.ObjectModel;
using NUnit.Framework;
@@ -32,10 +36,10 @@ namespace Microsoft.Plugin.Uri.UnitTests.UriHelper
[TestCase("http://test.c", true, "http://test.c/")]
[TestCase("http://test.co", true, "http://test.co/")]
[TestCase("http://test.com", true, "http://test.com/")]
[TestCase("http:3", true,"http://http:3/")]
[TestCase("http:3", true, "http://http:3/")]
[TestCase("[::]", true, "http://[::]/")]
[TestCase("[2001:0DB8::1]", true, "http://[2001:db8::1]/")]
[TestCase("[2001:0DB8::1]:80",true, "http://[2001:db8::1]/")]
[TestCase("[2001:0DB8::1]:80", true, "http://[2001:db8::1]/")]
public void TryParse_CanParseHostName(string query, bool expectedSuccess, string expectedResult)
{
// Arrange
@@ -50,4 +54,3 @@ namespace Microsoft.Plugin.Uri.UnitTests.UriHelper
}
}
}