public void CreateNewRequestBinGroupVerifyIfRequestBinGroupHasBeenCreated()
        {
            using (var requestBinUnitOfWork = new RequestBinUnitOfWorkModel(new EmptyDataFakeDatabase()))
            {
                IRequestBinService requestBinService = new RequestBinService(requestBinUnitOfWork);
                requestBinService.CreateGroup("TestGroupName");
                var group = requestBinService.GetGroup("TestGroupName");

                Assert.IsNotNull(group);
            }
        }
Exemple #2
0
 public void CreateNewRequestBinGroupVerifyIfRequestBinGroupHasBeenCreatedDeleteRequestBin()
 {
     using (var context = new RequestBinEfContext(_connectionString))
         using (var requestBinUnitOfWork = new RequestBinUnitOfWork(context))
         {
             IRequestBinService requestBinService = new RequestBinService(requestBinUnitOfWork);
             requestBinService.CreateGroup("TestGroupName");
             var group = requestBinService.GetGroup("TestGroupName");
             requestBinService.RemoveGroup(group);
             Assert.IsNotNull(group);
         }
 }
Exemple #3
0
        public ActionResult ResetGroup(WebRequestGroup webRequestGroup)
        {
            _infrastructreDataContext.InitializeRequestBinUnitOfWork(unitOfWork =>
            {
                ViewBag.ActiveMenuItem = "NewRequestBin";
                IRequestBinService webRequestService = new RequestBinService(unitOfWork);
                var group = webRequestService.GetGroup(webRequestGroup.GroupUniqueId);
                if (group != null)
                {
                    webRequestService.DeleteGroupRequests(group.Id);
                }
            });

            return(RedirectToAction("Index"));
        }
Exemple #4
0
        public ActionResult NewRequestBin(string groupName)
        {
            _infrastructreDataContext.InitializeRequestBinUnitOfWork(unitOfWork =>
            {
                ViewBag.ActiveMenuItem = "navRequestBinCreate";
                IRequestBinService webRequestService = new RequestBinService(unitOfWork);

                if (!string.IsNullOrEmpty(groupName) && webRequestService.GetGroup(groupName) == null)
                {
                    webRequestService.CreateNewGroup(groupName);
                }
                ViewBag.ActiveMenuItem = "navRequestBinCreate";
                _webRequestGroups      = webRequestService.Groups;
            });

            return(View(_webRequestGroups));
        }