public async void InvalidSubscribe()
        {
            var controller = new NewsletterSubscriptionController(null);

            controller.ModelState.AddModelError("Email", "Must be an email");

            var result = await controller.Subscribe(new NewsletterSubscription());

            Assert.IsType <BadRequestResult>(result);
        }
        public async void ValidSubscribe()
        {
            var model = new NewsletterSubscription {
                Email = "*****@*****.**"
            };

            var newsletterRepository = new Mock <INewsletterSubscriptionRepository>();

            newsletterRepository.Setup(repo => repo.Subscribe(model))
            .Returns(Task.FromResult(1));

            var controller = new NewsletterSubscriptionController(newsletterRepository.Object);
            var result     = await controller.Subscribe(model);

            Assert.IsType <OkResult>(result);
        }