Skip to content

Commit

Permalink
CSharpier format
Browse files Browse the repository at this point in the history
  • Loading branch information
gstraccini[bot] committed Dec 18, 2023
1 parent be1df19 commit 66f2379
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 22 deletions.
15 changes: 8 additions & 7 deletions Src/VTEX/VTEXContext.cs
Original file line number Diff line number Diff line change
Expand Up @@ -264,9 +264,10 @@ private Order GetOrderInternal(string orderId)
}
else if (
transaction.TransactionId != null
&& !transaction
.TransactionId
.Equals(@"NO-PAYMENT", StringComparison.InvariantCultureIgnoreCase)
&& !transaction.TransactionId.Equals(
@"NO-PAYMENT",
StringComparison.InvariantCultureIgnoreCase
)
)
{
LogConsumer.Info(@"Bank bill {0}", order.Sequence);
Expand Down Expand Up @@ -297,10 +298,10 @@ private Order GetOrderInternal(string orderId)
}

if (
order
.ClientProfileData
.Email
.IndexOf(@"ct.vtex", StringComparison.InvariantCultureIgnoreCase) != -1
order.ClientProfileData.Email.IndexOf(
@"ct.vtex",
StringComparison.InvariantCultureIgnoreCase
) != -1
)
{
order.ClientProfileData.Email = @"[email protected]";
Expand Down
21 changes: 8 additions & 13 deletions Src/VTEX/VTEXWrapper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -78,9 +78,7 @@ private static string InternalUserAgent
}

var assembly = System

Check warning on line 80 in Src/VTEX/VTEXWrapper.cs

View workflow job for this annotation

GitHub Actions / Qodana for .NET

Possible 'System.NullReferenceException'

Possible 'System.NullReferenceException'
.Reflection
.Assembly
.GetAssembly(typeof(VTEXWrapper))
.Reflection.Assembly.GetAssembly(typeof(VTEXWrapper))
.GetName();
_internalUserAgent = $@"{assembly.Name}/{assembly.Version}";
return _internalUserAgent;
Expand Down Expand Up @@ -288,16 +286,13 @@ private void ConfigureClient(HttpClient client, bool requiresAuthentication)
{
client.DefaultRequestHeaders.ExpectContinue = false;
client.DefaultRequestHeaders.Accept.Clear();
client
.DefaultRequestHeaders
.Accept
.Add(new MediaTypeWithQualityHeaderValue(@"application/json"));
client
.DefaultRequestHeaders
.TryAddWithoutValidation(
@"User-Agent",
$@"guiBranco-VTEX-SDK-dotnet {InternalUserAgent} +https://github.com/guibranco/VTEX-SDK-dotnet"
);
client.DefaultRequestHeaders.Accept.Add(
new MediaTypeWithQualityHeaderValue(@"application/json")
);
client.DefaultRequestHeaders.TryAddWithoutValidation(
@"User-Agent",
$@"guiBranco-VTEX-SDK-dotnet {InternalUserAgent} +https://github.com/guibranco/VTEX-SDK-dotnet"
);
if (!requiresAuthentication)
{
return;
Expand Down
3 changes: 1 addition & 2 deletions Tests/VTEX.Tests/Health/VtexHealthClientTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,7 @@ public async Task ValidateHealthClient()
.ReturnsAsync(fixtures);

var result = await clientMock
.Object
.GetPlatformStatuesAsync(CancellationToken.None)
.Object.GetPlatformStatuesAsync(CancellationToken.None)
.ConfigureAwait(false);

Assert.NotNull(result);
Expand Down

0 comments on commit 66f2379

Please sign in to comment.