Пример #1
0
        public void Should_create_a_client_with_correct_key()
        {
            // Arrange
            var apiKey = "fb6cd31d4b0f2ff22bc3d2a90edc58d3-us5";
            var dc = "us5";

            // Act
            var client = new MailChimpClient(apiKey);

            // Assert
            client.ShouldNotBe(null);
            client.ApiKey.ShouldBe(apiKey);
            client.Dc.ShouldBe(dc);
        }
        public void New_Subscriber_Is_Added()
        {
            MailChimpClient client = new MailChimpClient(Constants.ApiKey);

            var request = new AddSubscriberRequest(Constants.ListId);

            request.EmailAddress = "*****@*****.**";
            request.Status       = SubscriberStatus.Subscribed;
            request.MergeFields  = new Dictionary <string, object>()
            {
                { "subscribe", "GET FREE PDF" }, { "JARBOO_PLA", "GetPdfEbook" }
            };
            var response = client.Subscribers.Post(request);

            Assert.IsNotNull(response);
            Assert.IsNotNull(response.Result);
        }
Пример #3
0
 public SubscriberService()
 {
     _mailChimpClient = new MailChimpClient();
 }