Skip to content

Commit

Permalink
-Fix up tests
Browse files Browse the repository at this point in the history
-Fix project issue
-Upgrade some old dependencies
  • Loading branch information
brandonseydel committed Jul 31, 2019
1 parent 1742add commit f9a75e7
Show file tree
Hide file tree
Showing 7 changed files with 27 additions and 17 deletions.
2 changes: 1 addition & 1 deletion MailChimp.Net.Tests/CampaignTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ public async Task Should_Return_No_Campaigns_After_Removal()
await this.MailChimpManager.Campaigns.DeleteAsync(campaign.Id).ConfigureAwait(false);
var existingCampaigns = await this.MailChimpManager.Campaigns.GetAllAsync().ConfigureAwait(false);

Assert.Equal(0, existingCampaigns.Count());
Assert.Empty(existingCampaigns);
}
}
}
4 changes: 2 additions & 2 deletions MailChimp.Net.Tests/FeedbackTest.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// --------------------------------------------------------------------------------------------------------------------
// --------------------------------------------------------------------------------------------------------------------
// <copyright file="FeedbackTest.cs" company="Brandon Seydel">
// N/A
// </copyright>
Expand Down Expand Up @@ -98,7 +98,7 @@ public async Task Should_Return_No_Feedback_After_Removal()
await this.MailChimpManager.Feedback.DeleteAsync(campaign.Id, createdFeedback.FeedbackId.Value.ToString());
var feedback = await this.MailChimpManager.Feedback.GetAllAsync(campaign.Id);

Assert.Equal(0, feedback.Count());
Assert.Empty(feedback);
}

private async Task<Campaign> CreateCampaign()
Expand Down
4 changes: 2 additions & 2 deletions MailChimp.Net.Tests/ListTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public async Task Should_Delete_All_Lists()
var allLists = await this.MailChimpManager.Lists.GetAllAsync().ConfigureAwait(false);
await Task.WhenAll(allLists.Select(x => this.MailChimpManager.Lists.DeleteAsync(x.Id))).ConfigureAwait(false);
allLists = await this.MailChimpManager.Lists.GetAllAsync().ConfigureAwait(false);
Assert.Equal(0, allLists.Count());
Assert.Empty(allLists);
}

/// <summary>
Expand Down Expand Up @@ -161,7 +161,7 @@ public async Task Should_Batch_List_Update_Name()
UpdateExisting = false
}, newList.Id);

Assert.True(updatedList.NewMembers.Any(x => x.EmailAddress == testEmail));
Assert.Contains(updatedList.NewMembers, x => x.EmailAddress == testEmail);
}
}
}
4 changes: 2 additions & 2 deletions MailChimp.Net.Tests/ListWebhookTests.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using System.Threading.Tasks;
using System.Threading.Tasks;
using FluentAssertions;
using MailChimp.Net.Models;
using Xunit;
Expand Down Expand Up @@ -50,7 +50,7 @@ public async Task Should_Create_Webhook()
response.Id.Should().NotBeEmpty();
response.ListId.Should().Be(_listId);
response.Links.Should().NotBeEmpty();
response.ShouldBeEquivalentTo(webhook,
response.Should().BeEquivalentTo(webhook,
o => o.Excluding(i => i.Id).Excluding(i => i.ListId).Excluding(i => i.Links));

existingWebhook.Should().NotBeNull();
Expand Down
9 changes: 6 additions & 3 deletions MailChimp.Net.Tests/MailChimp.Net.Tests.csproj
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>netcoreapp2.0</TargetFramework>
Expand All @@ -10,9 +10,12 @@

<ItemGroup>
<PackageReference Include="FluentAssertions" Version="5.7.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.0.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.2.0" />
<PackageReference Include="NETStandard.Library" Version="2.0.3" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.3.0-beta3-build3705" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.1">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="1.1.1" />
<PackageReference Include="xunit" Version="2.4.1" />
</ItemGroup>
Expand Down
6 changes: 3 additions & 3 deletions MailChimp.Net.Tests/TemplateTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public async Task Should_Delete_All_User_Templates()
var allTemplates = await this.MailChimpManager.Templates.GetAllAsync(RequestOnlyUserTemplates).ConfigureAwait(false);
await Task.WhenAll(allTemplates.Select(x => this.MailChimpManager.Templates.DeleteAsync(x.Id))).ConfigureAwait(false);
allTemplates = await this.MailChimpManager.Templates.GetAllAsync(RequestOnlyUserTemplates).ConfigureAwait(false);
Assert.Equal(0, allTemplates.Count());
Assert.Empty(allTemplates);
}

/// <summary>
Expand All @@ -47,7 +47,7 @@ public async Task Should_Delete_All_Test_TemplateFolders()
var allTemplateFolders = await this.MailChimpManager.TemplateFolders.GetAllAsync().ConfigureAwait(false);
await Task.WhenAll(allTemplateFolders.Where(n => n.Name.StartsWith("TestFolder_")).Select(x => this.MailChimpManager.TemplateFolders.DeleteAsync(x.Id))).ConfigureAwait(false);
allTemplateFolders = await this.MailChimpManager.TemplateFolders.GetAllAsync().ConfigureAwait(false);
Assert.Equal(0, allTemplateFolders.Where(n => n.Name.StartsWith("TestFolder_")).Count());
Assert.Empty(allTemplateFolders.Where(n => n.Name.StartsWith("TestFolder_")));
}

/// <summary>
Expand Down Expand Up @@ -82,7 +82,7 @@ public async Task<Template> Should_Create_New_Template_With_FolderId()
var templateFolder = await Should_Create_New_TemplateFolder();

var template = await this.MailChimpManager.Configure((mo) => mo.Limit = 10).Templates.CreateAsync($"Test_{DateTime.UtcNow.Ticks}", templateFolder.Id, "<html><body><h1>Test *|FNAME|* </body></html>").ConfigureAwait(false);
var allTemplates = await this.MailChimpManager.Lists.GetAllAsync().ConfigureAwait(false);
var allTemplates = await this.MailChimpManager.Templates.GetAllAsync().ConfigureAwait(false);
Assert.True(allTemplates.Any());
return template;
}
Expand Down
15 changes: 11 additions & 4 deletions MailChimp.Net/MailChimp.Net.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>true</Optimize>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
Expand All @@ -31,7 +31,7 @@
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<AssemblyOriginatorKeyFile>MailChimp.Key.snk</AssemblyOriginatorKeyFile>
<PackageId>MailChimp.Net.V3</PackageId>
<Version>4.1.0</Version>
<Version>4.2.0</Version>
<Authors>Brandon Seydel</Authors>
<Company>DevSquad</Company>
<Product>MailChimp.Net.V3</Product>
Expand All @@ -47,11 +47,12 @@
.NETFramework 4.5</PackageReleaseNotes>
<PackageIconUrl>http://logos-download.com/wp-content/uploads/2016/09/MailChimp_logo_icon_Freddie_Wink.png</PackageIconUrl>
<PackageTags>MailChimp Mail Chimp 3.0 v3.0 MailChimp.Net.V3 MailChimpv3.0 MailChimpv3 MailChimp3</PackageTags>
<PackageLicenseUrl>https://github.com/brandonseydel/MailChimp.Net/blob/master/LICENSE.txt</PackageLicenseUrl>
<PackageLicenseUrl></PackageLicenseUrl>
<PackageLicenseFile>LICENSE.txt</PackageLicenseFile>

</PropertyGroup>
<ItemGroup>
<PackageReference Include="Newtonsoft.Json" Version="10.0.3" />
<PackageReference Include="Newtonsoft.Json" Version="12.0.2" />
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'netstandard1.3'">
Expand All @@ -61,6 +62,12 @@
<ItemGroup Condition="'$(TargetFramework)' != 'netstandard1.3'">
<Reference Include="System.Net.Http" />
</ItemGroup>
<ItemGroup>
<None Include="..\LICENSE.txt">
<Pack>True</Pack>
<PackagePath></PackagePath>
</None>
</ItemGroup>



Expand Down

0 comments on commit f9a75e7

Please sign in to comment.