From f9a75e70fab128287987129165b7e2f7977d5b1a Mon Sep 17 00:00:00 2001 From: Brandon Seydel Date: Wed, 31 Jul 2019 07:30:04 -0500 Subject: [PATCH] -Fix up tests -Fix project issue -Upgrade some old dependencies --- MailChimp.Net.Tests/CampaignTest.cs | 2 +- MailChimp.Net.Tests/FeedbackTest.cs | 4 ++-- MailChimp.Net.Tests/ListTest.cs | 4 ++-- MailChimp.Net.Tests/ListWebhookTests.cs | 4 ++-- MailChimp.Net.Tests/MailChimp.Net.Tests.csproj | 9 ++++++--- MailChimp.Net.Tests/TemplateTest.cs | 6 +++--- MailChimp.Net/MailChimp.Net.csproj | 15 +++++++++++---- 7 files changed, 27 insertions(+), 17 deletions(-) diff --git a/MailChimp.Net.Tests/CampaignTest.cs b/MailChimp.Net.Tests/CampaignTest.cs index a03c62f1..e2e03b7b 100644 --- a/MailChimp.Net.Tests/CampaignTest.cs +++ b/MailChimp.Net.Tests/CampaignTest.cs @@ -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); } } } \ No newline at end of file diff --git a/MailChimp.Net.Tests/FeedbackTest.cs b/MailChimp.Net.Tests/FeedbackTest.cs index d28c6d7d..d7598de6 100644 --- a/MailChimp.Net.Tests/FeedbackTest.cs +++ b/MailChimp.Net.Tests/FeedbackTest.cs @@ -1,4 +1,4 @@ -// -------------------------------------------------------------------------------------------------------------------- +// -------------------------------------------------------------------------------------------------------------------- // // N/A // @@ -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 CreateCampaign() diff --git a/MailChimp.Net.Tests/ListTest.cs b/MailChimp.Net.Tests/ListTest.cs index f4c5c24d..1a0b058c 100644 --- a/MailChimp.Net.Tests/ListTest.cs +++ b/MailChimp.Net.Tests/ListTest.cs @@ -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); } /// @@ -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); } } } \ No newline at end of file diff --git a/MailChimp.Net.Tests/ListWebhookTests.cs b/MailChimp.Net.Tests/ListWebhookTests.cs index 65689078..ab193dab 100644 --- a/MailChimp.Net.Tests/ListWebhookTests.cs +++ b/MailChimp.Net.Tests/ListWebhookTests.cs @@ -1,4 +1,4 @@ -using System.Threading.Tasks; +using System.Threading.Tasks; using FluentAssertions; using MailChimp.Net.Models; using Xunit; @@ -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(); diff --git a/MailChimp.Net.Tests/MailChimp.Net.Tests.csproj b/MailChimp.Net.Tests/MailChimp.Net.Tests.csproj index 28710a19..33eb2d77 100644 --- a/MailChimp.Net.Tests/MailChimp.Net.Tests.csproj +++ b/MailChimp.Net.Tests/MailChimp.Net.Tests.csproj @@ -1,4 +1,4 @@ - + netcoreapp2.0 @@ -10,9 +10,12 @@ - + - + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + diff --git a/MailChimp.Net.Tests/TemplateTest.cs b/MailChimp.Net.Tests/TemplateTest.cs index de953428..69c4222d 100644 --- a/MailChimp.Net.Tests/TemplateTest.cs +++ b/MailChimp.Net.Tests/TemplateTest.cs @@ -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); } /// @@ -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_"))); } /// @@ -82,7 +82,7 @@ public async Task