public void testPaymentFailedSucceeds() { emailHelper.Setup(e => e.SendStripeSubscription(It.IsAny<string>())); var eventController = new EventController(emailHelper.Object, subscriptionService.Object, organizationService.Object); HttpRequestMessage msg = new HttpRequestMessage(); eventController.Request = msg; eventController.Post(failedJson); }
public void testInvoiceSucceeds() { emailHelper.Setup(e => e.SendStripeInvoice(It.IsAny<StripeInvoice>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>())); List<Organization> list = new List<Organization>(); var org = new Organization { Admin = new Admin { Id = 1, Person = new DomainModel.Core.Person { Id = 1, FirstName = "Ian", UserId = 1, ContactInformation = new DomainModel.Core.ContactInformation { Email1 = "*****@*****.**" } } }, Subscription = new DomainModel.Core.Organization.Subscription.Subscription { Last4Digits = "1234" } }; list.Add(org); subscriptionService.Setup(s => s.GetCustomerSubscription(It.IsAny<string>())).Returns(new DomainModel.Core.Organization.Subscription.SubscriptionDetails { CustomerId = "asd" }); organizationService.Setup(o=>o.Get(It.IsAny<Expression<Func<Organization, bool>>>(),null,null)).Returns(list.AsQueryable()); var eventController = new EventController(emailHelper.Object, subscriptionService.Object, organizationService.Object); HttpRequestMessage msg = new HttpRequestMessage(); eventController.Request = msg; eventController.Post(invoiceJson); }