public void CustomerWithSubscriptionThatIsExpiredGetsCharged()
        {
            var customer = new Customer() {Subscribed = true};
            var processor = TestableBillingProcesor.Create(customer);

            processor.ProcesMonth(2011, 8);

            processor.Charger.Verify(c => c.ChargerCustomer(customer), Times.Once);
        }
        public void CustomerWhoNotHaveSubscriptionDoesNotGetCharged()
        {
            var customer = new Customer();
            var processor = TestableBillingProcesor.Create(customer);

            processor.ProcesMonth(2011, 8);

            processor.Charger.Verify(c => c.ChargerCustomer(customer), Times.Never);
        }
        public void CustomerWithSubscriptionThatIsExpiredGetsCharged()
        {
            var repo = new Mock<ICustomerRepository>();
            var charger = new Mock<ICreditCardCharger>();
            var customer = new Customer() {Subscribed = true};
            repo.Setup(r => r.Customers).Returns(new Customer[] { customer });
            var processor = new BillingDoohickey(repo.Object, charger.Object);

            processor.ProcesMonth(2011, 8);

            charger.Verify(c => c.ChargerCustomer(customer), Times.Once);
        }
        public void CustomerWhoNotHaveSubscriptionDoesNotGetCharged()
        {
            var repo = new Mock<ICustomerRepository>();
            var charger = new Mock<ICreditCardCharger>();
            var customer = new Customer() { Subscribed = false };
            repo.Setup(r => r.Customers).Returns(new Customer[] { customer });
            var processor = new BillingDoohickey(repo.Object, charger.Object);

            processor.ProcesMonth(2011, 8);

            charger.Verify(c => c.ChargerCustomer(customer), Times.Never);
        }