public void GivenThisExistingCustomer(Table table) { var values = table.Rows.Single(); _actor.AttemptsTo(DeleteCustomers.WithName(values["Name"])); _storedCustomer = new CustomerInfo( values["Title"], values["Name"], values["Address Line 1"], values["Address Line 2"], values["Address Line 3"], values["Postcode"], values["Home Phone"], values["Mobile"], 1); _actor.AttemptsTo( InsertCustomer.Named(values["Name"]) .Titled(values["Title"]) .OfAddress( values["Address Line 1"], values["Address Line 2"], values["Address Line 3"], values["Postcode"]) .WithHomePhone(values["Home Phone"]) .WithMobile(values["Mobile"])); }
public void GivenTheFollowingCustomers(Table table) { table.Rows.ForEach(values => { _actor.AttemptsTo( DeleteCustomers.WithName(values["Name"]), InsertCustomer.Named(values["Name"]) .Titled(values["Title"]) .OfAddress( values["Address Line 1"], values["Address Line 2"], values["Address Line 3"], values["Postcode"]) .WithHomePhone(values["Home Phone"]) .WithMobile(values["Mobile"])); }); }
public void GivenThisExistingCustomer(Table table) { var values = table.Rows.Single(); _actor.AttemptsTo(DeleteCustomers.WithName(values["Name"])); _actor.AttemptsTo( InsertCustomer.Named(values["Name"]) .Titled(values.GetStringOrDefault("Title")) .OfAddress( values.GetStringOrDefault("Address Line 1"), values.GetStringOrDefault("Address Line 2"), values.GetStringOrDefault("Address Line 3"), values.GetStringOrDefault("Postcode")) .WithHomePhone(values.GetStringOrDefault("Home Phone")) .WithMobile(values.GetStringOrDefault("Mobile")) .WithAccountInvoicingSetTo(values.GetBoolOrDefault("Account Invoicing"))); _storedCustomer = _actor.AsksFor(StoredCustomer.WithName(values["Name"])); }