diff --git a/MailChimp.Net.Tests/CampaignTest.cs b/MailChimp.Net.Tests/CampaignTest.cs index 7fc738a3..a03c62f1 100644 --- a/MailChimp.Net.Tests/CampaignTest.cs +++ b/MailChimp.Net.Tests/CampaignTest.cs @@ -164,6 +164,17 @@ public async Task Should_Return_Campaigns() [Fact] public async Task Should_Return_One_Campaign() { + var campaign = await this.MailChimpManager.Campaigns.AddAsync(new Campaign + { + Settings = new Setting + { + ReplyTo = "test@test.com", + Title = "Get Rich or Die Trying To Add Campaigns", + FromName = "AddCampaign", + SubjectLine = "TestingAddCampaign" + }, + Type = CampaignType.Plaintext + }).ConfigureAwait(false); var campaigns = await this.MailChimpManager.Campaigns.GetAll(new CampaignRequest { Limit = 1 }); Assert.True(campaigns.Count() == 1); } diff --git a/MailChimp.Net.Tests/SegmentTest.cs b/MailChimp.Net.Tests/SegmentTest.cs index a6c43331..63f77dc0 100644 --- a/MailChimp.Net.Tests/SegmentTest.cs +++ b/MailChimp.Net.Tests/SegmentTest.cs @@ -13,25 +13,32 @@ public class SegmentTest : MailChimpTest [Fact] public async Task Should_Get_Segment() { - var lists = await this.MailChimpManager.Lists.GetAllAsync().ConfigureAwait(false); - var listId = lists.First().Id; - - var segment = new Segment() + try { - Name = DateTime.Now.ToString(), - Options = new SegmentOptions() + var createList = await this.MailChimpManager.Lists.AddOrUpdateAsync(this.GetMailChimpList()); + var lists = await this.MailChimpManager.Lists.GetAllAsync().ConfigureAwait(false); + var listId = lists.First().Id; + + var segment = new Segment() { - Match = Match.All, - Conditions = new List() - } - }; + Name = DateTime.Now.ToString(), + Options = new SegmentOptions() + { + Match = Match.All, + Conditions = new List() + } + }; - var createdSegment = await this.MailChimpManager.ListSegments.AddAsync(listId, segment).ConfigureAwait(false); + var createdSegment = await this.MailChimpManager.ListSegments.AddAsync(listId, segment).ConfigureAwait(false); - var retrievedSegment = await this.MailChimpManager.ListSegments.GetAsync(listId, createdSegment.Id).ConfigureAwait(false); + var retrievedSegment = await this.MailChimpManager.ListSegments.GetAsync(listId, createdSegment.Id).ConfigureAwait(false); - Assert.NotNull(retrievedSegment); - Assert.True(createdSegment.Id == retrievedSegment.Id); + Assert.NotNull(retrievedSegment); + Assert.True(createdSegment.Id == retrievedSegment.Id); + }catch(Exception ex) + { + throw ex; + } } } diff --git a/MailChimp.Net/MailChimp.Net.csproj b/MailChimp.Net/MailChimp.Net.csproj index b286ba03..df4d7ddd 100644 --- a/MailChimp.Net/MailChimp.Net.csproj +++ b/MailChimp.Net/MailChimp.Net.csproj @@ -31,14 +31,14 @@ true MailChimp.Key.snk MailChimp.Net.V3 - 3.5.0 + 4.0.0 Brandon Seydel DevSquad MailChimp.Net.V3 MailChimp.Net.V3 A .NET Wrapper for Mail Chimp v3.0 API A very fast, thin, and intuitive .NET Wrapper for the Mail Chimp v3.0 API. - Copyright © 2018 + Copyright © 2019 https://github.com/brandonseydel/MailChimp.Net https://github.com/brandonseydel/MailChimp.Net Git