예제 #1
0
        public void CancelSubscription_SubscriptionExists_Successful()
        {
            //Arrange
            stripeAccessor = new StripeAccessorService(subService.Object, charService.Object, cusService.Object);

            //Act
            string returnedId = stripeAccessor.CancelSubscription(customerId, subscriptionId);

            //Assert
            Assert.That(returnedId, Is.EqualTo(subscriptionId));
        }
예제 #2
0
        public void CancelSubscription_InvalidParameters_ThrowsException()
        {
            //Arrange
            Exception exception = new Exception();

            Mock<StripeSubscriptionService> custSubService = new Mock<StripeSubscriptionService>(null);
            custSubService.Setup(sub => sub.Cancel(It.IsAny<string>(), It.IsAny<string>(), false, null)).Throws(exception);
            stripeAccessor = new StripeAccessorService(custSubService.Object, charService.Object, cusService.Object);

            //Act
            string returnMessage = stripeAccessor.CancelSubscription(customerId, subscriptionId);

            //Assert
            Assert.That(returnMessage, Is.Null);
        }