Skip to content

Commit 1704752

Browse files
Minor refactorings and dependencies updates
1 parent abf5208 commit 1704752

File tree

6 files changed

+12
-13
lines changed

6 files changed

+12
-13
lines changed

FluentEmail.MailerSend.Tests/FluentEmail.MailerSend.Tests.csproj

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,14 @@
99
</PropertyGroup>
1010

1111
<ItemGroup>
12-
<PackageReference Include="FluentAssertions" Version="6.7.0" />
13-
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.2.0" />
14-
<PackageReference Include="xunit" Version="2.4.1" />
15-
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.5">
12+
<PackageReference Include="FluentAssertions" Version="6.12.0" />
13+
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.9.0" />
14+
<PackageReference Include="xunit" Version="2.7.0" />
15+
<PackageReference Include="xunit.runner.visualstudio" Version="2.5.7">
1616
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
1717
<PrivateAssets>all</PrivateAssets>
1818
</PackageReference>
19-
<PackageReference Include="coverlet.msbuild" Version="3.1.2">
19+
<PackageReference Include="coverlet.msbuild" Version="6.0.1">
2020
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
2121
<PrivateAssets>all</PrivateAssets>
2222
</PackageReference>

FluentEmail.MailerSend.Tests/MailerSendSenderTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ public async void SendEmailTest()
1919
.Body("<html><body><h1>Test</h1><p>Greetings from the team, you got this message through MailerSend.</p></body></html>", true)
2020
.Tag("test_tag")
2121
.SendAsync()
22-
.ConfigureAwait(false);
22+
.ConfigureAwait(true);
2323

2424
response.MessageId.Should().BeEmpty();
2525
response.ErrorMessages.Should().BeEmpty();

FluentEmail.MailerSend/FluentEmail.MailerSend.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
<Authors>Marco Ribeiro</Authors>
1010
<Company />
1111
<PackageId>FluentEmail.MailerSend</PackageId>
12-
<PackageVersion>1.0.0</PackageVersion>
12+
<PackageVersion>1.0.1</PackageVersion>
1313
<PackageTags>mailersend;email;razor;liquid;fluent;fluentemail</PackageTags>
1414
<PackageLicenseExpression>MIT OR Apache-2.0</PackageLicenseExpression>
1515
</PropertyGroup>

FluentEmail.MailerSend/FluentEmailMailerSendBuilderExtensions.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,13 @@
22
using FluentEmail.MailerSend;
33
using Microsoft.Extensions.DependencyInjection.Extensions;
44
using System;
5-
using System.Collections.Generic;
65

76
namespace Microsoft.Extensions.DependencyInjection
87
{
98
public static class FluentEmailMailerSendBuilderExtensions
109
{
11-
public static FluentEmailServicesBuilder AddMailerSendSender(this FluentEmailServicesBuilder builder, string apiToken, Action<MailerSendOptions>? options = null)
10+
public static FluentEmailServicesBuilder AddMailerSendSender(this FluentEmailServicesBuilder builder,
11+
string apiToken, Action<MailerSendOptions>? options = null)
1212
{
1313
builder.Services.TryAdd(ServiceDescriptor.Scoped<ISender>(_ => new MailerSendSender(apiToken, options)));
1414
return builder;

FluentEmail.MailerSend/MailerSendSender.cs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,16 +20,15 @@ public class MailerSendSender : ISender
2020
private const string _emailEndPoint = "email";
2121

2222
private readonly HttpClient _httpClient;
23-
private readonly string _apiKey;
2423
private readonly MailerSendOptions _options = new MailerSendOptions();
2524

2625
public MailerSendSender(string apiKey, Action<MailerSendOptions>? options = null)
2726
{
28-
_apiKey = apiKey ?? throw new ArgumentNullException(nameof(apiKey));
27+
var apiKey1 = apiKey ?? throw new ArgumentNullException(nameof(apiKey));
2928
options?.Invoke(_options);
3029

3130
_httpClient = new HttpClient { BaseAddress = new Uri(_baseAddress) };
32-
_httpClient.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", _apiKey);
31+
_httpClient.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", apiKey1);
3332
}
3433

3534
public SendResponse Send(IFluentEmail email, CancellationToken? token = null)

FluentEmail.MailerSend/Utils/StringExtensions.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ internal static class StringExtensions
66
{
77
public static string ToSnakeCase(this string str)
88
{
9-
return string.Concat(str.Select((x, i) => i > 0 && char.IsUpper(x) ? "_" + x.ToString() : x.ToString())).ToLower();
9+
return string.Concat(str.Select((x, i) => i > 0 && char.IsUpper(x) ? "_" + x : x.ToString())).ToLower();
1010
}
1111
}
1212
}

0 commit comments

Comments
 (0)