public void WhenIViewTheCustomer()
        {
            _storedCustomer.Should().NotBeNull();

            int customerId = _actor.AsksFor(StoredCustomerId.ForName(_storedCustomer.Name));

            _actor.AttemptsTo(ViewCustomer.WithId(customerId));
        }
        public void WhenIUpdateTheCustomerWithANewMobileNumberOf(string newMobileNumber)
        {
            _storedCustomer.Should().NotBeNull();

            int customerId = _actor.AsksFor(StoredCustomerId.ForName(_storedCustomer.Name));

            _actor.AttemptsTo(
                ViewCustomer.WithId(customerId),
                SendKeys.To(CustomerMaintenancePage.Mobile, newMobileNumber),
                Click.On(CustomerMaintenancePage.Save));
        }
Ejemplo n.º 3
0
        public void GivenTheseExistingCars(Table table)
        {
            table.Rows.ForEach(values =>
            {
                _actor.AttemptsTo(DeleteCar.ByRegistration(values["Registration"]));

                int customerId = _actor.AsksFor(
                    values.ContainsKey("Customer") ? StoredCustomerId.ForName(values["Customer"]) : StoredCustomerId.First());

                _actor.AttemptsTo(
                    InsertCar.WithRegistration(values["Registration"])
                    .ForCustomer(customerId)
                    .WithMake(values["Make"])
                    .WithModel(values["Model"]));
            });
        }
Ejemplo n.º 4
0
        public void WhenICreateANewCarResourceWithTheFollowingDetails(Table table)
        {
            var values = table.Rows.Single();

            int customerId = _actor.AsksFor(StoredCustomerId.ForName(values["Customer"]));

            _newCarInput = new CarInfo
            {
                Registration        = values["Registration"],
                CustomerId          = customerId,
                Make                = values["Make"],
                Model               = values["Model"],
                MotExpiry           = values.GetDateOrDefault("MOT Expiry"),
                SuppressMotReminder = values.GetBool("Suppress MOT Reminder")
            };

            _lastResponse.Response = _actor.Calls(Post.Resource(_newCarInput).To("api/car"));
        }
Ejemplo n.º 5
0
        public void GivenTheFollowingExistingCar(Table table)
        {
            var values = table.Rows.Single();

            _actor.AttemptsTo(DeleteCar.WithRegistration(values["Registration"]));

            int customerId = _actor.AsksFor(StoredCustomerId.ForName(values["Customer"]));

            _actor.AttemptsTo(
                InsertCar.WithRegistration(values["Registration"])
                .ForCustomer(customerId)
                .WithMake(values.GetStringOrDefault("Make"))
                .WithModel(values.GetStringOrDefault("Model"))
                .MotExpiringOn(values.GetDateOrDefault("MOT Expiry"))
                .SuppressingMotReminder(values.GetBoolOrDefault("Suppress MOT Reminder")));

            _storedCar = _actor.AsksFor(StoredCar.WithRegistration(values["Registration"]));
        }