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); } }
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); } }
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")); }
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)); }