-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ShouldSendAndCopyMessageAsync -> FAIL
- Loading branch information
1 parent
6ddf20b
commit cbab9dc
Showing
5 changed files
with
81 additions
and
16 deletions.
There are no files selected for viewing
36 changes: 36 additions & 0 deletions
36
FlexiMail.Test.Integration/Clients/FlexiMailClientTests.SendAndCopy.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
// --------------------------------------- | ||
// Copyright (c) 2024 Mabrouk Mahdhi. | ||
// Made with love for the .NET Community | ||
// --------------------------------------- | ||
|
||
using FlexiMail.Models.Foundations.Bodies; | ||
using FlexiMail.Models.Foundations.Messages; | ||
|
||
namespace FlexiMail.Test.Integration.Clients | ||
{ | ||
public partial class FlexiMailClientTests | ||
{ | ||
[Fact] | ||
public async void ShouldSendAndCopyMessageAsync() | ||
Check warning on line 14 in FlexiMail.Test.Integration/Clients/FlexiMailClientTests.SendAndCopy.cs GitHub Actions / build
Check warning on line 14 in FlexiMail.Test.Integration/Clients/FlexiMailClientTests.SendAndCopy.cs GitHub Actions / build
|
||
{ | ||
// Given | ||
var flexiMessage = new FlexiMessage() | ||
{ | ||
Subject = "FlexiMessage is a cool library", | ||
To = [GetReceiverTestEmail()], | ||
Body = new FlexiBody | ||
{ | ||
Content = "<h3>This is a test</h3><p>Bonjour tout le monde!</p>", | ||
ContentType = BodyContentType.Html | ||
} | ||
}; | ||
|
||
// when | ||
var sendMessageTask = | ||
this.flexiMailClient.SendAndSaveCopyAsync(flexiMessage); | ||
|
||
// then | ||
Assert.True(sendMessageTask.IsCompletedSuccessfully, "The message should be sent and copied successfully."); | ||
} | ||
} | ||
} |
40 changes: 40 additions & 0 deletions
40
FlexiMail.Test.Integration/Clients/FlexiMailClientTests.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
// --------------------------------------- | ||
// Copyright (c) 2024 Mabrouk Mahdhi. | ||
// Made with love for the .NET Community | ||
// --------------------------------------- | ||
|
||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using FlexiMail.Models.Configurations; | ||
|
||
namespace FlexiMail.Test.Integration.Clients | ||
{ | ||
public partial class FlexiMailClientTests | ||
{ | ||
private readonly IFlexiMailClient flexiMailClient; | ||
|
||
public FlexiMailClientTests() | ||
{ | ||
var tenantId = Environment.GetEnvironmentVariable("TenantId",EnvironmentVariableTarget.Machine); | ||
var authority = $"https://login.microsoftonline.com/{tenantId}"; | ||
|
||
var configurations = new ExchangeConfigurations | ||
{ | ||
ClientId = Environment.GetEnvironmentVariable("ClientId"), | ||
ClientSecret = Environment.GetEnvironmentVariable("ClientSecret"), | ||
TenantId = tenantId, | ||
Authority = authority, | ||
SmtpAddress = Environment.GetEnvironmentVariable("SmtpAddress"), | ||
PrincipalName = Environment.GetEnvironmentVariable("PrincipalName"), | ||
Sid = Environment.GetEnvironmentVariable("Sid"), | ||
Scopes = ["https://outlook.office365.com/.default"], | ||
}; | ||
|
||
this.flexiMailClient = new FlexiMailClient(configurations); | ||
} | ||
|
||
private static string GetReceiverTestEmail() => | ||
Environment.GetEnvironmentVariable("FlexiTestEmail"); | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters