Ejemplo n.º 1
0
        public void OnSaveGetsCustomerIdFromService()
        {
            MockOrderGeneralInformation order = GetPopulatedDisplayOrder();

            view.Order = order;

            presenter.OnSave();

            Assert.IsTrue(customerService.GetCustomersByNameCalled);
            Assert.AreEqual(customerService.GetCustomerByName(order.CustomerName).CustomerId, controller.CurrentOrder.CustomerId);
        }
Ejemplo n.º 2
0
        private MockOrderGeneralInformation GetPopulatedDisplayOrder()
        {
            MockOrderGeneralInformation order = new MockOrderGeneralInformation();

            order.Number       = "1";
            order.Approver     = "11";
            order.CustomerName = "John Smith";
            order.Address      = "225 112th NE Street";
            order.City         = "Bellevue";
            order.State        = "Washington";
            order.PostalCode   = "98005";
            order.OrderName    = "ORDER1";
            order.Description  = "Needs it quick";
            return(order);
        }
Ejemplo n.º 3
0
        public void ShouldSaveOrderInControllerOnSave()
        {
            MockOrderGeneralInformation order = GetPopulatedDisplayOrder();

            view.Order = order;

            presenter.OnSave();

            Assert.IsTrue(controller.SaveCurrentOrderAsDraftCalled);
            Assert.IsFalse(controller.CurrentOrder.OrderId > 0);
            Assert.AreEqual(order.Approver, controller.CurrentOrder.Approver);
            Assert.AreEqual(order.Address, controller.CurrentOrder.ShipAddress);
            Assert.AreEqual(order.City, controller.CurrentOrder.ShipCity);
            Assert.AreEqual(order.State, controller.CurrentOrder.ShipRegion);
            Assert.AreEqual(order.OrderName, controller.CurrentOrder.OrderName);
            Assert.AreEqual(order.Description, controller.CurrentOrder.Description);
        }
 private MockOrderGeneralInformation GetPopulatedDisplayOrder()
 {
     MockOrderGeneralInformation order = new MockOrderGeneralInformation();
     order.Number = "1";
     order.Approver = "11";
     order.CustomerName = "John Smith";
     order.Address = "225 112th NE Street";
     order.City = "Bellevue";
     order.State = "Washington";
     order.PostalCode = "98005";
     order.OrderName = "ORDER1";
     order.Description = "Needs it quick";
     return order;
 }