Skip to content

Commit e73971a

Browse files
author
John Campion Jr
committed
fixed missing checks for credentials
1 parent b4f061e commit e73971a

2 files changed

Lines changed: 5 additions & 1 deletion

File tree

test/FluentEmail.Core.Tests/ThirdParty/AzureEmailSenderTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ public class AzureEmailSenderTests
2121

2222
public AzureEmailSenderTests()
2323
{
24-
Sender = new AzureEmailSender(_connectionString);
24+
if (!string.IsNullOrEmpty(_connectionString)) Sender = new AzureEmailSender(_connectionString);
2525
}
2626

2727
[Fact]

test/FluentEmail.Core.Tests/ThirdParty/PostmarkSenderTests.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -277,27 +277,31 @@ public async Task SimpleMailFromCodeWithHeaders()
277277
[Fact]
278278
public void SenderNullServerToken()
279279
{
280+
Assert.SkipWhen(string.IsNullOrEmpty(_apiKey), "No Postmark Credentials");
280281
Func<PostmarkSender> fn = () => new PostmarkSender((string)null!);
281282
fn.Should().Throw<ArgumentNullException>();
282283
}
283284

284285
[Fact]
285286
public void OptionsNullServerToken()
286287
{
288+
Assert.SkipWhen(string.IsNullOrEmpty(_apiKey), "No Postmark Credentials");
287289
Func<PostmarkSenderOptions> fn = () => new PostmarkSenderOptions(null!);
288290
fn.Should().Throw<ArgumentNullException>();
289291
}
290292

291293
[Fact]
292294
public void NullOptions()
293295
{
296+
Assert.SkipWhen(string.IsNullOrEmpty(_apiKey), "No Postmark Credentials");
294297
Func<PostmarkSender> fn = () => new PostmarkSender((PostmarkSenderOptions)null!);
295298
fn.Should().Throw<ArgumentNullException>();
296299
}
297300

298301
[Fact]
299302
public void SendNull()
300303
{
304+
Assert.SkipWhen(string.IsNullOrEmpty(_apiKey), "No Postmark Credentials");
301305
var sender = new PostmarkSender(_apiKey);
302306
Func<Task> fn = async () => await sender.SendAsync(null!).ConfigureAwait(false);
303307
fn.Should().ThrowAsync<ArgumentNullException>();

0 commit comments

Comments
 (0)