Пример #1
0
 public LocationTest()
 {
     address     = new Address("1123 Fletcher St", "Tampa", "Florida");
     sut         = new lo.Location(address);
     userAddress = new Address("51 Viking Oak", "Tampa", "Florida");
     user        = new us.User("admin", "password", userAddress);
 }
Пример #2
0
        public static bool SetLocation(lo.Location location, pdm.Address address)
        {
            var dataAddress = new Address()
            {
                Street = address.Street,
                City   = address.City,
                State  = address.State
            };

            _db.Address.Add(dataAddress);

            var dataLocation = new Location()
            {
                AddressId   = dataAddress.AddressId,
                OrderNumber = location.OrderNumber
            };

            _db.Location.Add(dataLocation);

            var newLocation = _db.Location.Where(a => a.AddressId == dataLocation.AddressId).FirstOrDefault();

            InitLocationInventory(newLocation.LocationId);

            return(_db.SaveChanges() == 3);
        }
Пример #3
0
        public UserTest()
        {
            address     = new Address("1123 Fletcher St", "Tampa", "Florida");
            userAddress = new Address("51 Viking Oak", "Tampa", "Florida");

            sut      = new us.User("admin", "password", userAddress);
            location = new lo.Location(address);

            sut.CreateOrder(location.OrderNumber, location.Address);
        }
Пример #4
0
        public static List <pi.Pizza> GetPizzaByLocation(lo.Location location)
        {
            var dataLocation = _db.Location.Where(l => l.LocationId == location.LocationId).FirstOrDefault();

            if (dataLocation == null)
            {
                return(null);
            }

            return(GetPizzas(dataLocation.Order));
        }
Пример #5
0
        public OrderTest()
        {
            address     = new Address("1123 Fletcher St", "Tampa", "Florida");
            userAddress = new Address("51 Viking Oak", "Tampa", "Florida");

            location = new lo.Location(address);
            user     = new us.User("admin", "password", userAddress);
            sut      = new ord.Order(user.Username, location.OrderNumber, location.Address);

            crust   = new pi.Crust();
            size    = new pi.Size();
            topping = new pi.Toppings();
        }
Пример #6
0
 public static bool SetLocation(lo.Location location, pdm.Address address)
 {
     return(LocationHelper.SetLocation(location, address));
 }