Beispiel #1
0
        public async Task EmptyRecycleBin()
        {
            // Arrange
            var client = TestFactory.CreateDotMailerCoreClient();

            // Act
            await client.EmptyRecycleBinAsync();
        }
        public async Task DeleteCampaign()
        {
            // Arrange
            var client     = TestFactory.CreateDotMailerCoreClient();
            var campaignId = TestFactory.GetCampaignId();

            // Act
            await client.DeleteCampaignAsync(campaignId);
        }
        public async Task DeleteAddressBook()
        {
            // Arrange
            var client        = TestFactory.CreateDotMailerCoreClient();
            var addressBookId = TestFactory.GetAddressBookId();

            // Act
            await client.DeleteAddressBookAsync(addressBookId);
        }
        public async Task GetCampaigns_ReturnsACampaignListResponse()
        {
            // Arrange
            var client = TestFactory.CreateDotMailerCoreClient();

            // Act
            var response = await client.GetCampaignsAsync();

            // Assert
            var model = Assert.IsAssignableFrom <List <Campaign> >(response);
        }
Beispiel #5
0
        public async Task GetAccountInformation_ReturnsAnAccountResponse()
        {
            // Arrange
            var client = TestFactory.CreateDotMailerCoreClient();

            // Act
            var baseResponse = await client.GetAccountInformationAsync();

            // Assert
            var model = Assert.IsAssignableFrom <Account>(baseResponse);
        }
        public async Task GetAddressBooks_ReturnsAnAddressBooksResponse()
        {
            // Arrange
            var client = TestFactory.CreateDotMailerCoreClient();

            // Act
            var response = await client.GetAddressBooksAsync();

            // Assert
            var model = Assert.IsAssignableFrom <List <AddressBook> >(response);
        }
        public async Task SendTimeOptimisedCampaign_ReturnsACampaignSendStatusResponse()
        {
            // Arrange
            var campaignSend = TestFactory.GetCampaignSend();
            var client       = TestFactory.CreateDotMailerCoreClient();

            // Act
            var response = await client.SendTimeOptimisedCampaignAsync(campaignSend);

            // Assert
            var model = Assert.IsAssignableFrom <CampaignSend>(response);
        }
        public async Task CreateSplitTestCampaign_ReturnsASplitTestCampaignResponse()
        {
            // Arrange
            var client   = TestFactory.CreateDotMailerCoreClient();
            var campaign = TestFactory.GetSplitTestCampaign();

            // Act
            var response = await client.CreateSplitTestCampaignAsync(campaign);

            // Assert
            var model = Assert.IsAssignableFrom <SplitTestCampaign>(response);
        }
        public async Task GetCampaignSummary_ReturnsACampaignSummaryResponse()
        {
            // Arrange
            var client     = TestFactory.CreateDotMailerCoreClient();
            var campaignId = TestFactory.GetCampaignId();

            // Act
            var response = await client.GetCampaignSummaryAsync(campaignId);

            // Assert
            var model = Assert.IsAssignableFrom <CampaignSummary>(response);
        }
        public async Task CreateAddressBook_ReturnsAnAddressBookResponse()
        {
            // Arrange
            var client      = TestFactory.CreateDotMailerCoreClient();
            var addressBook = TestFactory.GetAddressBook();

            // Act
            var response = await client.CreateAddressBookAsync(addressBook);

            // Assert
            var model = Assert.IsAssignableFrom <AddressBook>(response);
        }
        public async Task GetCampaignAttatchments_ReturnsAnErrorResponse()
        {
            // Arrange
            var campaignId = TestFactory.GetCampaignId();
            var client     = TestFactory.CreateDotMailerCoreClient();

            // Act
            var ex = await Assert.ThrowsAsync <ApiException>(() => client.GetCampaignAttachmentsAsync(campaignId));

            // Assert
            Assert.Equal((int)HttpStatusCode.Forbidden, ex.HttpStatus);
            Assert.Contains("ERROR_FEATURENOTACTIVE", ex.ResponseContent);
        }
        public async Task GetPrivateAddressBooks_ReturnsAPublicAddressBooksResponse()
        {
            // Arrange
            var client = TestFactory.CreateDotMailerCoreClient();

            // Act
            var response = await client.GetPublicAddressBooksAsync();

            // Assert
            var model = Assert.IsAssignableFrom <List <AddressBook> >(response);

            Assert.True(model.Where(x => x.Visibility == AddressBookVisibility.Public).Count() == model.Count());
        }
        public async Task CopyCampaign_ReturnsACampaignResponse()
        {
            // Arrange
            var client   = TestFactory.CreateDotMailerCoreClient();
            var campaign = TestFactory.GetCampaign();

            // Act
            var response = await client.UpdateCampaignAsync(campaign);

            // Assert
            var model = Assert.IsAssignableFrom <Campaign>(response);

            Equals(model.Id, campaign.Id);
        }
        public async Task GetAddressBook_ReturnsAnAddressBookResponse()
        {
            // Arrange
            var client = TestFactory.CreateDotMailerCoreClient();
            var id     = TestFactory.GetAddressBookId();

            // Act
            var response = await client.GetAddressBookAsync(id);

            // Assert
            var model = Assert.IsAssignableFrom <AddressBook>(response);

            Equals(model.Id, id);
        }