示例#1
0
        public void ShouldHandleSubscriptionRequest()
        {
            string email    = "*****@*****.**";
            string listName = "the_daily";

            var result = _subscriptionService.AddListSubscriber(email, listName);

            Assert.IsInstanceOf(typeof(OptInResponse), result);
        }
示例#2
0
 public IHttpActionResult PostOptIn(OptInRequest request)
 {
     try
     {
         var response = _subscriptionService.AddListSubscriber(request.EmailAddress, request.ListName);
         return(this.Ok(response));
     }
     catch (System.Exception ex)
     {
         return(this.InternalServerError());
     }
 }