Skip to content

Commit

Permalink
Remove warning disablements that are no longer needed
Browse files Browse the repository at this point in the history
  • Loading branch information
marcpopMSFT committed Sep 18, 2023
1 parent 52f0582 commit f7f5173
Show file tree
Hide file tree
Showing 5 changed files with 0 additions and 28 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -272,9 +272,7 @@ public void CanAssignAliasForParameterWithReservedAlias(string parameterName, st
}

[Theory]
#pragma warning disable CA1825 // Avoid zero-length array allocations. /~https://github.com/dotnet/sdk/issues/28672
[MemberData(nameof(GetTemplateData))]
#pragma warning restore CA1825 // Avoid zero-length array allocations.
public void CanOverrideAliasesForParameterWithHostData(string hostJsonData, string expectedJsonResult)
{
var hostData = new HostSpecificTemplateData(string.IsNullOrEmpty(hostJsonData) ? null : JObject.Parse(hostJsonData));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -281,9 +281,7 @@ public static IEnumerable<object[]> GetInvalidParametersTestData()
}

[Theory]
#pragma warning disable CA1825 // Avoid zero-length array allocations. /~https://github.com/dotnet/sdk/issues/28672
[MemberData(nameof(GetInvalidParametersTestData))]
#pragma warning restore CA1825 // Avoid zero-length array allocations.
// invalid params:
// [0] name / value - Kind
// [1] canonical
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,7 @@ public void Create_CanParseTemplateWithOptions()
}

[Theory]
#pragma warning disable CA1825 // Avoid zero-length array allocations. /~https://github.com/dotnet/sdk/issues/28672
[MemberData(nameof(CanEvaluateTemplateToRunData))]
#pragma warning restore CA1825 // Avoid zero-length array allocations.
internal void Create_CanEvaluateTemplateToRun(string command, string templateSet, string? defaultLanguage, string? expectedIdentitiesStr)
{
TemplateGroup templateGroup = TemplateGroup.FromTemplateList(
Expand Down Expand Up @@ -123,9 +121,7 @@ internal void Create_CanValidateOptionUsage_InNewCommand(string command, string?
}

[Theory]
#pragma warning disable CA1825 // Avoid zero-length array allocations. /~https://github.com/dotnet/sdk/issues/28672
[MemberData(nameof(CanParseTemplateOptionsData))]
#pragma warning restore CA1825 // Avoid zero-length array allocations.
internal void Create_CanParseTemplateOptions(string command, string parameterName, string parameterType, string? defaultValue, string? defaultIfNoOptionValue, string? expectedValue)
{
//unique case for dotnet new create
Expand Down Expand Up @@ -166,9 +162,7 @@ internal void Create_CanParseTemplateOptions(string command, string parameterNam
}

[Theory]
#pragma warning disable CA1825 // Avoid zero-length array allocations. /~https://github.com/dotnet/sdk/issues/28672
[MemberData(nameof(CanParseChoiceTemplateOptionsData))]
#pragma warning restore CA1825 // Avoid zero-length array allocations.
internal void Create_CanParseChoiceTemplateOptions(string command, string parameterName, string parameterValues, string? defaultIfNoOptionValue, string? expectedValue)
{
MockTemplateInfo template = new MockTemplateInfo("foo", identity: "foo.1", groupIdentity: "foo.group")
Expand Down Expand Up @@ -203,9 +197,7 @@ internal void Create_CanParseChoiceTemplateOptions(string command, string parame
}

[Theory]
#pragma warning disable CA1825 // Avoid zero-length array allocations. /~https://github.com/dotnet/sdk/issues/28672
[MemberData(nameof(CanDetectParseErrorsTemplateOptionsData))]
#pragma warning restore CA1825 // Avoid zero-length array allocations.
internal void Create_CanDetectParseErrorsTemplateOptions(
string command,
string parameterName,
Expand Down Expand Up @@ -239,9 +231,7 @@ internal void Create_CanDetectParseErrorsTemplateOptions(
}

[Theory]
#pragma warning disable CA1825 // Avoid zero-length array allocations. /~https://github.com/dotnet/sdk/issues/28672
[MemberData(nameof(CanDetectParseErrorsChoiceTemplateOptionsData))]
#pragma warning restore CA1825 // Avoid zero-length array allocations.
internal void Create_CanDetectParseErrorsChoiceTemplateOptions(
string command,
string parameterName,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -205,9 +205,7 @@ public void Instantiate_CanParseTemplateWithOptions()
};

[Theory]
#pragma warning disable CA1825 // Avoid zero-length array allocations. /~https://github.com/dotnet/sdk/issues/28672
[MemberData(nameof(CanEvaluateTemplateToRunData))]
#pragma warning restore CA1825 // Avoid zero-length array allocations.
internal void CanEvaluateTemplateToRun(string command, string templateSet, string? defaultLanguage, string? expectedIdentitiesStr)
{
TemplateGroup templateGroup = TemplateGroup.FromTemplateList(
Expand Down Expand Up @@ -304,9 +302,7 @@ internal void CanParseNameOption(string command, string? expectedValue)
};

[Theory]
#pragma warning disable CA1825 // Avoid zero-length array allocations. /~https://github.com/dotnet/sdk/issues/28672
[MemberData(nameof(CanParseTemplateOptionsData))]
#pragma warning restore CA1825 // Avoid zero-length array allocations.
internal void CanParseTemplateOptions(string command, string parameterName, string parameterType, string? defaultValue, string? defaultIfNoOptionValue, string? expectedValue)
{
MockTemplateInfo template = new MockTemplateInfo("foo", identity: "foo.1", groupIdentity: "foo.group")
Expand Down Expand Up @@ -350,9 +346,7 @@ internal void CanParseTemplateOptions(string command, string parameterName, stri
};

[Theory]
#pragma warning disable CA1825 // Avoid zero-length array allocations. /~https://github.com/dotnet/sdk/issues/28672
[MemberData(nameof(CanParseChoiceTemplateOptionsData))]
#pragma warning restore CA1825 // Avoid zero-length array allocations.
internal void CanParseChoiceTemplateOptions(string command, string parameterName, string parameterValues, string? defaultIfNoOptionValue, string? expectedValue)
{
MockTemplateInfo template = new MockTemplateInfo("foo", identity: "foo.1", groupIdentity: "foo.group")
Expand Down Expand Up @@ -396,9 +390,7 @@ internal void CanParseChoiceTemplateOptions(string command, string parameterName
};

[Theory]
#pragma warning disable CA1825 // Avoid zero-length array allocations. /~https://github.com/dotnet/sdk/issues/28672
[MemberData(nameof(CanParseMultiChoiceTemplateOptionsData))]
#pragma warning restore CA1825 // Avoid zero-length array allocations.
internal void CanParseMultiChoiceTemplateOptions(string command, string parameterName, string parameterValues, string? defaultIfNoOptionValue, string? expectedValue)
{
MockTemplateInfo template = new MockTemplateInfo("foo", identity: "foo.1", groupIdentity: "foo.group")
Expand Down Expand Up @@ -461,9 +453,7 @@ internal void CanParseMultiChoiceTemplateOptions(string command, string paramete
};

[Theory]
#pragma warning disable CA1825 // Avoid zero-length array allocations. /~https://github.com/dotnet/sdk/issues/28672
[MemberData(nameof(CanDetectParseErrorsTemplateOptionsData))]
#pragma warning restore CA1825 // Avoid zero-length array allocations.
internal void CanDetectParseErrorsTemplateOptions(
string command,
string parameterName,
Expand Down Expand Up @@ -507,9 +497,7 @@ internal void CanDetectParseErrorsTemplateOptions(
};

[Theory]
#pragma warning disable CA1825 // Avoid zero-length array allocations. /~https://github.com/dotnet/sdk/issues/28672
[MemberData(nameof(CanDetectParseErrorsChoiceTemplateOptionsData))]
#pragma warning restore CA1825 // Avoid zero-length array allocations.
internal void CanDetectParseErrorsChoiceTemplateOptions(
string command,
string parameterName,
Expand Down
2 changes: 0 additions & 2 deletions src/Tests/dotnet-new.Tests/CommonTemplatesTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -320,9 +320,7 @@ public async void AotVariants(string name, string language)

[Theory]
//creates all possible combinations for supported templates, language versions and frameworks
#pragma warning disable CA1825 // Avoid zero-length array allocations. /~https://github.com/dotnet/sdk/issues/28672
[MemberData(nameof(FeaturesSupport_Data))]
#pragma warning restore CA1825 // Avoid zero-length array allocations.
public async void FeaturesSupport(
string name,
bool buildPass,
Expand Down

0 comments on commit f7f5173

Please sign in to comment.