예제 #1
0
        public void TestDeleteStoreQueues()
        {
            ContextSeeder.Seed();
            var bo         = new StoreQueueBusinessObject();
            var resList    = bo.List();
            var resDelete  = bo.Delete(resList.Result.First().Id);
            var resNotList = bo.List().Result.Where(x => !x.IsDeleted).ToList();

            Assert.IsTrue(resDelete.Success && resNotList.Count == 0);
        }
예제 #2
0
        public void TestUpdateStoreQueuesAsync()
        {
            ContextSeeder.Seed();
            var bo         = new StoreQueueBusinessObject();
            var resultList = bo.List();
            var item       = resultList.Result.FirstOrDefault();

            item.Quantity = 24;
            var resUpdate  = bo.UpdateAsync(item).Result;
            var resNotList = bo.List().Result.Where(x => !x.IsDeleted);

            Assert.IsTrue(resUpdate.Success && resNotList.First().Quantity == 24);
        }
예제 #3
0
        public void TestListStoreQueues()
        {
            ContextSeeder.Seed();
            var bo      = new StoreQueueBusinessObject();
            var resList = bo.List();

            Assert.IsTrue(resList.Success && resList.Result.Count == 1);
        }
예제 #4
0
        public void TestUpdateStoreQueue()
        {
            ContextSeeder.Seed();
            var bo       = new StoreQueueBusinessObject();
            var stoQList = bo.List();
            var item     = stoQList.Result.FirstOrDefault();

            item.Quantity = 10;
            var stoQUpdate  = bo.Update(item);
            var stoQNotList = bo.ListNotDeleted().Result;

            Assert.IsTrue(stoQUpdate.Success && stoQNotList.First().Quantity == 10);
        }
예제 #5
0
 public ActionResult<List<StoreQueueViewModel>> List()
 {
     var res = _bo.List();
     if (!res.Success) return StatusCode((int)HttpStatusCode.InternalServerError);
     var list = new List<StoreQueueViewModel>();
     foreach (var item in res.Result)
     {
         list.Add(new StoreQueueViewModel
         {
             Id = item.Id,
             EstablishmentId = item.EstablishmentId,
             Quantity = item.Quantity
         });
     }
     return list;
 }
예제 #6
0
        public ActionResult <List <StoreQueueViewModel> > List()
        {
            var res = _bo.List();

            if (!res.Success)
            {
                return(InternalServerError());
            }
            var list = new List <StoreQueueViewModel>();

            foreach (var item in res.Result)
            {
                list.Add(StoreQueueViewModel.Parse(item));
            }
            return(list);
        }