-
Notifications
You must be signed in to change notification settings - Fork 38
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
54 changed files
with
752 additions
and
438 deletions.
There are no files selected for viewing
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
29 changes: 29 additions & 0 deletions
29
Source/StrongGrid.IntegrationTests/Tests/EngagementQuality.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,29 @@ | ||
using System; | ||
using System.IO; | ||
using System.Linq; | ||
using System.Threading; | ||
using System.Threading.Tasks; | ||
|
||
namespace StrongGrid.IntegrationTests.Tests | ||
{ | ||
public class EngagementQuality : IIntegrationTest | ||
{ | ||
public Task RunAsync(IBaseClient client, TextWriter log, CancellationToken cancellationToken) | ||
{ | ||
return RunAsync((IClient)client, log, cancellationToken); | ||
} | ||
|
||
public async Task RunAsync(IClient client, TextWriter log, CancellationToken cancellationToken) | ||
{ | ||
if (cancellationToken.IsCancellationRequested) return; | ||
|
||
await log.WriteLineAsync("\n***** ENGAGEMENT QUALITY *****\n").ConfigureAwait(false); | ||
|
||
var startDate = DateTime.UtcNow.AddDays(-89); // The SendGrid API restricts the start date to 90 days in the past | ||
var endDate = DateTime.UtcNow; | ||
|
||
var metrics = await client.EngagementQuality.GetScoresAsync(startDate, endDate, null, cancellationToken).ConfigureAwait(false); | ||
await log.WriteLineAsync($"Retrieved {metrics.Count()} engagement metrics").ConfigureAwait(false); | ||
} | ||
} | ||
} |
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
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
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
Oops, something went wrong.