Primary constructors cannot have readonly parameters. Not worth using.

This commit is contained in:
Jordan Dominion
2024-09-22 13:41:28 -04:00
parent 6b276f6216
commit 00467fd77e
2 changed files with 11 additions and 8 deletions
+2 -5
View File
@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
<RuleSet Name="myrules" Description="My rule set" ToolsVersion="17.0">
<Rules AnalyzerId="AsyncUsageAnalyzers" RuleNamespace="AsyncUsageAnalyzers">
<Rule Id="UseConfigureAwait" Action="Warning" />
@@ -6,7 +6,6 @@
<Rules AnalyzerId="Microsoft.Analyzers.ManagedCodeAnalysis" RuleNamespace="Microsoft.Rules.Managed">
<Rule Id="CA1000" Action="Warning" />
<Rule Id="CA1001" Action="Warning" />
<Rule Id="CA1002" Action="None" />
<Rule Id="CA1003" Action="Warning" />
<Rule Id="CA1004" Action="Warning" />
<Rule Id="CA1005" Action="Warning" />
@@ -669,7 +668,6 @@
</Rules>
<Rules AnalyzerId="Microsoft.CodeAnalysis.CSharp.CodeStyle" RuleNamespace="Microsoft.CodeAnalysis.CSharp.CodeStyle">
<Rule Id="IDE0028" Action="None" />
<Rule Id="IDE0290" Action="None" />
<Rule Id="IDE0301" Action="None" />
</Rules>
<Rules AnalyzerId="Microsoft.CodeAnalysis.CSharp.EditorFeatures" RuleNamespace="Microsoft.CodeAnalysis.CSharp.EditorFeatures">
@@ -756,7 +754,6 @@
<Rule Id="IDE0048WithoutSuggestion" Action="Warning" />
<Rule Id="IDE0049" Action="None" />
<Rule Id="IDE0049WithoutSuggestion" Action="None" />
<Rule Id="IDE0290" Action="None" />
<Rule Id="IDE0301" Action="None" />
<Rule Id="IDE1005" Action="Warning" />
<Rule Id="IDE1005WithoutSuggestion" Action="Warning" />
@@ -1048,4 +1045,4 @@
<Rules AnalyzerId="Text.CSharp.Analyzers" RuleNamespace="Text.CSharp.Analyzers">
<Rule Id="CA1704" Action="Warning" />
</Rules>
</RuleSet>
</RuleSet>
@@ -12,10 +12,16 @@ using Tgstation.Server.Common.Extensions;
namespace Tgstation.Server.Tests.Live
{
sealed class MultiServerClient(IRestServerClient restServerClient, IGraphQLServerClient graphQLServerClient) : IAsyncDisposable
sealed class MultiServerClient : IAsyncDisposable
{
public IRestServerClient RestClient { get; } = restServerClient ?? throw new ArgumentNullException(nameof(restServerClient));
public IGraphQLServerClient GraphQLClient { get; } = graphQLServerClient ?? throw new ArgumentNullException(nameof(graphQLServerClient));
public IRestServerClient RestClient { get; }
public IGraphQLServerClient GraphQLClient { get; }
public MultiServerClient(IRestServerClient restServerClient, IGraphQLServerClient graphQLServerClient)
{
this.RestClient = restServerClient;
this.GraphQLClient = graphQLServerClient;
}
public static bool UseGraphQL => Boolean.TryParse(Environment.GetEnvironmentVariable("TGS_TEST_GRAPHQL"), out var result) && result;