public async Task EmptyRecycleBin() { // Arrange var mockRestResponse = TestFactory.CreateMockRestResponse(); var client = TestFactory.CreateDotMailerCoreClientWithResponse(mockRestResponse.Object); // Act await client.EmptyRecycleBinAsync(); }
public async Task DeleteCampaign() { // Arrange var mockRestResponse = TestFactory.CreateMockRestResponse(); var client = TestFactory.CreateDotMailerCoreClientWithResponse(mockRestResponse.Object); var campaignId = TestFactory.GetCampaignId(); // Act await client.DeleteCampaignAsync(campaignId); }
public async Task DeleteAddressBook() { // Arrange var mockRestResponse = TestFactory.CreateMockRestResponse(); var client = TestFactory.CreateDotMailerCoreClientWithResponse(mockRestResponse.Object); var addressBookId = TestFactory.GetAddressBookId(); // Act await client.DeleteAddressBookAsync(addressBookId); }
public async Task RemoveCampaignAttachment() { // Arrange var campaignId = TestFactory.GetCampaignId(); var campaignAttatchmentId = TestFactory.GetCampaignAttatchmentId(); var mockRestResponse = TestFactory.CreateMockRestResponse(); var client = TestFactory.CreateDotMailerCoreClientWithResponse(mockRestResponse.Object); // Act await client.RemoveCampaignAttachmentAsync(campaignId, campaignAttatchmentId); }
public async Task GetCampaigns_ReturnsACampaignListResponse() { // Arrange var mockRestResponse = TestFactory.CreateMockRestResponse <List <Campaign> >(Constants.CampaignsContent); var client = TestFactory.CreateDotMailerCoreClientWithResponse <List <Campaign> >(mockRestResponse.Object); // Act var response = await client.GetCampaignsAsync(); // Assert var model = Assert.IsAssignableFrom <List <Campaign> >(response); }
public async Task GetAccountInformation_ReturnsAnAccountResponse() { // Arrange var mockRestResponse = TestFactory.CreateMockRestResponse <Account>(Constants.AccountInformationContent); var client = TestFactory.CreateDotMailerCoreClientWithResponse <Account>(mockRestResponse.Object); // Act var baseResponse = await client.GetAccountInformationAsync(); // Assert var model = Assert.IsAssignableFrom <Account>(baseResponse); }
public async Task SendCampaign_ReturnsACampaignSendResponse() { // Arrange var mockRestResponse = TestFactory.CreateMockRestResponse <CampaignSend>(Constants.CampaignSendContent); var client = TestFactory.CreateDotMailerCoreClientWithResponse <CampaignSend>(mockRestResponse.Object); var campaignSend = TestFactory.GetCampaignSend(); // Act var response = await client.SendCampaignAsync(campaignSend); // Assert var model = Assert.IsAssignableFrom <CampaignSend>(response); }
public async Task CreateSplitTestCampaign_ReturnsASplitTestCampaignResponse() { // Arrange var mockRestResponse = TestFactory.CreateMockRestResponse <SplitTestCampaign>(Constants.CampaignSplitTestCreateContent); var client = TestFactory.CreateDotMailerCoreClientWithResponse <SplitTestCampaign>(mockRestResponse.Object); var campaign = TestFactory.GetSplitTestCampaign(); // Act var response = await client.CreateSplitTestCampaignAsync(campaign); // Assert var model = Assert.IsAssignableFrom <SplitTestCampaign>(response); }
public async Task CreateAddressBook_ReturnsAnAddressBookResponse() { // Arrange var mockRestResponse = TestFactory.CreateMockRestResponse <AddressBook>(Constants.AddressBookCreateContent); var client = TestFactory.CreateDotMailerCoreClientWithResponse <AddressBook>(mockRestResponse.Object); var addressBook = TestFactory.GetAddressBook(); // Act var response = await client.CreateAddressBookAsync(addressBook); // Assert var model = Assert.IsAssignableFrom <AddressBook>(response); }
public async Task AddCampaignAttachment_ReturnsAnAttachmentResponse() { // Arrange var campaignId = TestFactory.GetCampaignId(); var attatchment = TestFactory.GetCampaignAttatchment(); var mockRestResponse = TestFactory.CreateMockRestResponse <Attachment>(Constants.CampaignAddCampaignAttatchmentContent); var client = TestFactory.CreateDotMailerCoreClientWithResponse <Attachment>(mockRestResponse.Object); // Act var response = await client.AddCampaignAttachmentAsync(campaignId, attatchment); // Assert var model = Assert.IsAssignableFrom <Attachment>(response); }
public async Task GetPrivateAddressBooks_ReturnsAPrivateAddressBooksResponse() { // Arrange var mockRestResponse = TestFactory.CreateMockRestResponse <List <AddressBook> >(Constants.AddressBooksPrivateContent); var client = TestFactory.CreateDotMailerCoreClientWithResponse <List <AddressBook> >(mockRestResponse.Object); // Act var response = await client.GetPrivateAddressBooksAsync(); // Assert var model = Assert.IsAssignableFrom <List <AddressBook> >(response); Assert.True(model.Where(x => x.Visibility == AddressBookVisibility.Private).Count() == model.Count()); }
public async Task CopyCampaign_ReturnsACampaignResponse() { // Arrange var mockRestResponse = TestFactory.CreateMockRestResponse <Campaign>(Constants.CampaignCopyContent); var client = TestFactory.CreateDotMailerCoreClientWithResponse <Campaign>(mockRestResponse.Object); var campaign = TestFactory.GetCampaign(); // Act var response = await client.UpdateCampaignAsync(campaign); // Assert var model = Assert.IsAssignableFrom <Campaign>(response); Equals(model.Id, campaign.Id); }