Skip to content

Commit

Permalink
Merge branch 'release/0.79.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
Jericho committed Apr 27, 2021
2 parents f2bc5c4 + cc7c84a commit 383d576
Show file tree
Hide file tree
Showing 7 changed files with 93 additions and 59 deletions.
8 changes: 4 additions & 4 deletions Source/StrongGrid.IntegrationTests/Tests/EmailActivities.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,23 +18,23 @@ public async Task RunAsync(IBaseClient client, TextWriter log, CancellationToken

// REQUEST THE MOST RECENT ACTIVITIES
var recentActivities = await client.EmailActivities.SearchAsync(null, maxNumberOfActivities, cancellationToken).ConfigureAwait(false);
await log.WriteLineAsync($"Activities requested. Found {recentActivities.Count()} activities.").ConfigureAwait(false);
await log.WriteLineAsync($"Activities requested. Found {recentActivities.Length} activities.").ConfigureAwait(false);

if (!recentActivities.Any()) return;

// REQUEST THE EVENTS FOR A SPECIFIC MESSAGE
var messageId = recentActivities.First().MessageId;
var summary = await client.EmailActivities.GetMessageSummaryAsync(messageId, cancellationToken).ConfigureAwait(false);
await log.WriteLineAsync($"There are {summary.Events.Count()} events associated with message {summary.MessageId}.").ConfigureAwait(false);
await log.WriteLineAsync($"There are {summary.Events.Length} events associated with message {summary.MessageId}.").ConfigureAwait(false);

// REQUEST THE ACTIVITIES OF A GIVEN STATUS
var activityStatus = recentActivities.First().Status;
var activities = await client.EmailActivities.SearchAsync(new SearchCriteriaEqual(EmailActivitiesFilterField.ActivityType, activityStatus), maxNumberOfActivities, cancellationToken).ConfigureAwait(false);
await log.WriteLineAsync($"There are {activities.Count()} '{activityStatus}' email activities.").ConfigureAwait(false);
await log.WriteLineAsync($"There are {activities.Length} '{activityStatus}' email activities.").ConfigureAwait(false);

// REQUEST THE ACTIVITIES WITH A GIVEN 'UNIQUE ARG'
activities = await client.EmailActivities.SearchAsync(new SearchCriteriaUniqueArgEqual("some_value_specific_to_this_person", "ABC_123"), maxNumberOfActivities, cancellationToken).ConfigureAwait(false);
await log.WriteLineAsync($"There are {activities.Count()} email activities with the 'some_value_specific_to_this_person' unique arg.").ConfigureAwait(false);
await log.WriteLineAsync($"There are {activities.Length} email activities with the 'some_value_specific_to_this_person' unique arg.").ConfigureAwait(false);
}
}
}
39 changes: 15 additions & 24 deletions Source/StrongGrid.sln
Original file line number Diff line number Diff line change
Expand Up @@ -3,48 +3,39 @@ Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 16
VisualStudioVersion = 16.0.28803.202
MinimumVisualStudioVersion = 10.0.40219.1
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Source", "Source", "{7F08B680-E39D-4201-A60A-22814CA5ABF4}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Tests", "Tests", "{92D9174E-51D2-459A-9C8B-9BF12B3BDA63}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{B20829B3-95C8-4C19-8D98-640F4BF9237A}"
ProjectSection(SolutionItems) = preProject
..\README.md = ..\README.md
EndProjectSection
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "StrongGrid", "StrongGrid\StrongGrid.csproj", "{451E4044-7AE3-4982-8F53-6B86AB788557}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "StrongGrid", "StrongGrid\StrongGrid.csproj", "{F4CEAECC-A03A-46C6-ACD5-18D1CD067624}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "StrongGrid.IntegrationTests", "StrongGrid.IntegrationTests\StrongGrid.IntegrationTests.csproj", "{C23B65C7-343A-4A34-B889-CEB294124B34}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "StrongGrid.IntegrationTests", "StrongGrid.IntegrationTests\StrongGrid.IntegrationTests.csproj", "{818E076C-1700-4F0A-A83E-3BA6376D06B7}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "StrongGrid.UnitTests", "StrongGrid.UnitTests\StrongGrid.UnitTests.csproj", "{B59A4579-50CC-4475-99E4-6EC3BB643CAC}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "StrongGrid.UnitTests", "StrongGrid.UnitTests\StrongGrid.UnitTests.csproj", "{8C68D4FA-EE10-4E79-87F2-10A426224B9F}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{451E4044-7AE3-4982-8F53-6B86AB788557}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{451E4044-7AE3-4982-8F53-6B86AB788557}.Debug|Any CPU.Build.0 = Debug|Any CPU
{451E4044-7AE3-4982-8F53-6B86AB788557}.Release|Any CPU.ActiveCfg = Release|Any CPU
{451E4044-7AE3-4982-8F53-6B86AB788557}.Release|Any CPU.Build.0 = Release|Any CPU
{C23B65C7-343A-4A34-B889-CEB294124B34}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{C23B65C7-343A-4A34-B889-CEB294124B34}.Debug|Any CPU.Build.0 = Debug|Any CPU
{C23B65C7-343A-4A34-B889-CEB294124B34}.Release|Any CPU.ActiveCfg = Release|Any CPU
{C23B65C7-343A-4A34-B889-CEB294124B34}.Release|Any CPU.Build.0 = Release|Any CPU
{B59A4579-50CC-4475-99E4-6EC3BB643CAC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{B59A4579-50CC-4475-99E4-6EC3BB643CAC}.Debug|Any CPU.Build.0 = Debug|Any CPU
{B59A4579-50CC-4475-99E4-6EC3BB643CAC}.Release|Any CPU.ActiveCfg = Release|Any CPU
{B59A4579-50CC-4475-99E4-6EC3BB643CAC}.Release|Any CPU.Build.0 = Release|Any CPU
{F4CEAECC-A03A-46C6-ACD5-18D1CD067624}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{F4CEAECC-A03A-46C6-ACD5-18D1CD067624}.Debug|Any CPU.Build.0 = Debug|Any CPU
{F4CEAECC-A03A-46C6-ACD5-18D1CD067624}.Release|Any CPU.ActiveCfg = Release|Any CPU
{F4CEAECC-A03A-46C6-ACD5-18D1CD067624}.Release|Any CPU.Build.0 = Release|Any CPU
{818E076C-1700-4F0A-A83E-3BA6376D06B7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{818E076C-1700-4F0A-A83E-3BA6376D06B7}.Debug|Any CPU.Build.0 = Debug|Any CPU
{818E076C-1700-4F0A-A83E-3BA6376D06B7}.Release|Any CPU.ActiveCfg = Release|Any CPU
{818E076C-1700-4F0A-A83E-3BA6376D06B7}.Release|Any CPU.Build.0 = Release|Any CPU
{8C68D4FA-EE10-4E79-87F2-10A426224B9F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{8C68D4FA-EE10-4E79-87F2-10A426224B9F}.Debug|Any CPU.Build.0 = Debug|Any CPU
{8C68D4FA-EE10-4E79-87F2-10A426224B9F}.Release|Any CPU.ActiveCfg = Release|Any CPU
{8C68D4FA-EE10-4E79-87F2-10A426224B9F}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(NestedProjects) = preSolution
{451E4044-7AE3-4982-8F53-6B86AB788557} = {7F08B680-E39D-4201-A60A-22814CA5ABF4}
{C23B65C7-343A-4A34-B889-CEB294124B34} = {92D9174E-51D2-459A-9C8B-9BF12B3BDA63}
{B59A4579-50CC-4475-99E4-6EC3BB643CAC} = {92D9174E-51D2-459A-9C8B-9BF12B3BDA63}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {1252F224-2007-4494-A5F5-5761702DFE96}
EndGlobalSection
Expand Down
44 changes: 40 additions & 4 deletions Source/StrongGrid/Models/GoogleAnalyticsSettings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,48 @@ public class GoogleAnalyticsSettings
public bool Enabled { get; set; }

/// <summary>
/// Gets or sets the substitution tag.
/// Gets or sets the utm source.
/// </summary>
/// <value>
/// The substitution tag.
/// The utm source.
/// </value>
[JsonProperty("substitution_tag", NullValueHandling = NullValueHandling.Ignore)]
public string SubstitutionTag { get; set; }
[JsonProperty("utm_source", NullValueHandling = NullValueHandling.Ignore)]
public string UtmSource { get; set; }

/// <summary>
/// Gets or sets the utm medium.
/// </summary>
/// <value>
/// The utm medium.
/// </value>
[JsonProperty("utm_medium", NullValueHandling = NullValueHandling.Ignore)]
public string UtmMedium { get; set; }

/// <summary>
/// Gets or sets the utm term.
/// </summary>
/// <value>
/// The utm term.
/// </value>
[JsonProperty("utm_term", NullValueHandling = NullValueHandling.Ignore)]
public string UtmTerm { get; set; }

/// <summary>
/// Gets or sets the content of the utm.
/// </summary>
/// <value>
/// The content of the utm.
/// </value>
[JsonProperty("utm_content", NullValueHandling = NullValueHandling.Ignore)]
public string UtmContent { get; set; }

/// <summary>
/// Gets or sets the utm campaign.
/// </summary>
/// <value>
/// The utm campaign.
/// </value>
[JsonProperty("utm_campaign", NullValueHandling = NullValueHandling.Ignore)]
public string UtmCampaign { get; set; }
}
}
1 change: 0 additions & 1 deletion Source/StrongGrid/Resources/Settings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ namespace StrongGrid.Resources
/// </remarks>
public class Settings : ISettings
{
private const string _endpoint = "settings";
private readonly Pathoschild.Http.Client.IClient _client;

/// <summary>
Expand Down
2 changes: 1 addition & 1 deletion appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ cache:

# Environment configuration
image:
- Visual Studio 2019
- Ubuntu1804
- Visual Studio 2019

#---------------------------------#
# Skip builds for doc changes #
Expand Down
46 changes: 21 additions & 25 deletions build.cake
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,13 @@
#tool dotnet:?package=GitVersion.Tool&version=5.6.6
#tool nuget:?package=GitReleaseManager&version=0.11.0
#tool nuget:?package=OpenCover&version=4.7.922
#tool nuget:?package=ReportGenerator&version=4.8.7
#tool nuget:?package=ReportGenerator&version=4.8.8
#tool nuget:?package=coveralls.io&version=1.4.2
#tool nuget:?package=xunit.runner.console&version=2.4.1

// Install addins.
#addin nuget:?package=Cake.Coveralls&version=1.0.1
#addin nuget:?package=Cake.Git&version=1.0.1


///////////////////////////////////////////////////////////////////////////////
Expand All @@ -17,10 +18,8 @@
var target = Argument<string>("target", "Default");
var configuration = Argument<string>("configuration", "Release");

if (target == "AppVeyor" && IsRunningOnUnix())
{
target = "AppVeyor-Ubuntu";
}
if (IsRunningOnUnix()) target = "Run-Unit-Tests";


///////////////////////////////////////////////////////////////////////////////
// GLOBAL VARIABLES
Expand Down Expand Up @@ -123,10 +122,27 @@ Setup(context =>
string.IsNullOrEmpty(gitHubPassword) ? "[NULL]" : new string('*', gitHubPassword.Length)
);
}

// Integration tests are intended to be used for debugging purposes and not intended to be executed in CI environment.
// Also, the runner for these tests contains windows-specific code (such as resizing window, moving window to center of screen, etc.)
// which can cause problems when attempting to run unit tests on an Ubuntu image on AppVeyor.
if (IsRunningOnUnix())
{
Information("");
Information("Removing integration tests");
DotNetCoreTool(solutionFile, "sln", $"remove {integrationTestsProject.TrimStart(sourceFolder, StringComparison.OrdinalIgnoreCase)}");
}
});

Teardown(context =>
{
if (IsRunningOnUnix())
{
Information("Restoring integration tests");
GitCheckout(".", new FilePath[] { solutionFile });
Information("");
}

// Executed AFTER the last task.
Information("Finished running tasks.");
});
Expand All @@ -147,28 +163,8 @@ Task("AppVeyor-Build_Number")
});
});

Task("Remove-Integration-Tests")
.WithCriteria(() => AppVeyor.IsRunningOnAppVeyor)
.Does(() =>
{
// Integration tests are intended to be used for debugging purposes and not intended to be executed in CI environment.
// Also, the runner for these tests contains windows-specific code (such as resizing window, moving window to center of screen, etc.)
// which can cause problems when attempting to run unit tests on an Ubuntu image on AppVeyor.

Information("Here are the projects in the solution before removing integration tests:");
DotNetCoreTool(solutionFile, "sln", "list");
Information("");

DotNetCoreTool(solutionFile, "sln", $"remove {integrationTestsProject.TrimStart(sourceFolder, StringComparison.OrdinalIgnoreCase)}");
Information("");

Information("Here are the projects in the solution after removing integration tests:");
DotNetCoreTool(solutionFile, "sln", "list");
});

Task("Clean")
.IsDependentOn("AppVeyor-Build_Number")
.IsDependentOn("Remove-Integration-Tests")
.Does(() =>
{
// Clean solution directories.
Expand Down
12 changes: 12 additions & 0 deletions build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!/usr/bin/env bash
set -euox pipefail

cd "$(dirname "${BASH_SOURCE[0]}")"

export DOTNET_SKIP_FIRST_TIME_EXPERIENCE=1
export DOTNET_CLI_TELEMETRY_OPTOUT=1
export DOTNET_NOLOGO=1

dotnet tool restore

dotnet cake "$@"

0 comments on commit 383d576

Please sign in to comment.