Beispiel #1
0
        public void Promote_cannot_promote_a_gold_customer()
        {
            Customer customer     = CreateCustomer(status: CustomerStatus.Gold);
            var      emailGateway = new FakeEmailGateway();

            Response response = Invoke(x => x.Promote(customer.Id), emailGateway);

            response.ShouldBeError("The customer has the highest status possible");
            emailGateway.ShouldContainNumberOfPromotionNotificationsSent(0);
        }
Beispiel #2
0
        public void Promote_promotes_customer()
        {
            Customer customer     = CreateCustomer();
            var      emailGateway = new FakeEmailGateway();

            Response response = Invoke(x => x.Promote(customer.Id), emailGateway);

            response.ShouldBeOk();
            using (var db = new CustomerDatabase())
            {
                db.ShouldContainCustomer(customer.Id)
                .WithStatus(CustomerStatus.Preferred);

                emailGateway.ShouldContainNumberOfPromotionNotificationsSent(1);
            }
        }