public void GetStores() { var logic = new StoreLogic(new StoreOracleContext()); var listOfStores = logic.GetAllStores(); Assert.IsNotNull(listOfStores, "Getting stores failed"); }
/// <summary> /// The page_ load. /// </summary> /// <param name="sender"> /// The sender. /// </param> /// <param name="e"> /// The e. /// </param> protected void Page_Load(object sender, EventArgs e) { if (!this.Page.User.Identity.IsAuthenticated) { this.Response.Redirect("~/Login.aspx"); } // Loading articles this.workingman = new ShoppingCartActions(); this.transportman = new OrderLogic(new DeliveryOracleContext(), new PickupOracleContext(), new OrderOracleContext()); // Loading user var customerLogic = new CustomerLogic(new CustomerOracleContext()); this.currentCustomer = customerLogic.GetByEmail(HttpContext.Current.User.Identity.Name); // Put information in form this.HcustomerID.Value = this.currentCustomer.Id.ToString(); this.txtName.Text = this.currentCustomer.Name; this.txtAddress.Text = this.currentCustomer.Address; this.txtPostalCode.Text = this.currentCustomer.Postalcode; this.txtCity.Text = this.currentCustomer.City; this.txtTelePhoneNumber.Text = this.currentCustomer.Telephone; this.txtEmailAddress.Text = this.currentCustomer.Emailaddress; // Loading list of stores for picking up this.storeLogic = new StoreLogic(new StoreOracleContext()); foreach (var store in storeLogic.GetAllStores()) { this.drpStores.Items.Add("MyCom - " + store.Address); } // Loading fields for delivery this.txtAlterAddress.Text = this.currentCustomer.Address; this.txtAlterCity.Text = this.currentCustomer.City; this.txtAlterPostal.Text = this.currentCustomer.Postalcode; }
public void GetStore() { var logic = new StoreLogic(new StoreOracleContext()); var store = logic.GetById(1); Assert.IsNotNull(store , "Getting store failed"); }