public ActionResult Delete(int id) { var sprint = SprintService.SprintFetch(id); SprintService.SprintDelete(id); return(this.RedirectToAction("Edit", "Project", new { id = sprint.ProjectId })); }
public void Sprint_Fetch() { var sprint = SprintService.SprintNew(); var project = BusinessHelper.CreateProject(); sprint.ProjectId = project.ProjectId; sprint.Name = DataHelper.RandomString(20); sprint = SprintService.SprintSave(sprint); sprint = SprintService.SprintFetch(sprint.SprintId); Assert.IsFalse(sprint == null, "Sprint should not be null"); }
public ActionResult Edit(int id, SprintFormModel model) { var sprint = SprintService.SprintFetch(id); Csla.Data.DataMapper.Map(model, sprint, true, "ProjectName"); sprint = SprintService.SprintSave(sprint); if (sprint.IsValid) { model.Message = Resources.SaveSuccessfulMessage; } this.MapToModel(sprint, model, true); return(this.View(model)); }
public void Sprint_Fetch() { Exception exception = null; var sprint = BusinessHelper.CreateSprintAndLogon( SprintTestsWithRoleReview.UserName, SprintTestsWithRoleReview.UserPassword); try { SprintService.SprintFetch(sprint.SprintId); } catch (Exception ex) { exception = ex; } Assert.IsTrue(exception == null, "Exception should be null"); }
public ActionResult Edit(int id, string message) { var model = new SprintFormModel(); try { var sprint = SprintService.SprintFetch(id); model.Message = message; this.MapToModel(sprint, model, true); } catch (Exception ex) { this.ModelState.AddModelError(string.Empty, ex.Message); } return(this.View(model)); }
public void Sprint_Edit() { var sprint = SprintService.SprintNew(); var project = BusinessHelper.CreateProject(); var name = DataHelper.RandomString(20); sprint.ProjectId = project.ProjectId; sprint.Name = name; sprint = SprintService.SprintSave(sprint); sprint = SprintService.SprintFetch(sprint.SprintId); sprint.ProjectId = project.ProjectId; sprint.Name = DataHelper.RandomString(20); sprint = SprintService.SprintSave(sprint); sprint = SprintService.SprintFetch(sprint.SprintId); Assert.IsTrue(sprint.Name != name, "Name should have different value"); }
public void Sprint_Edit() { var sprint = BusinessHelper.CreateSprintAndLogon( SprintTestsWithRoleContribute.UserName, SprintTestsWithRoleContribute.UserPassword); Exception exception = null; try { sprint = SprintService.SprintFetch(sprint.SprintId); sprint.Name = DataHelper.RandomString(20); SprintService.SprintSave(sprint); } catch (Exception ex) { exception = ex; } Assert.IsTrue(exception == null, "Exception should be null"); }
public void Sprint_Edit() { var sprint = BusinessHelper.CreateSprintAndLogon( SprintTestsWithRoleReview.UserName, SprintTestsWithRoleReview.UserPassword); Exception exception = null; try { sprint = SprintService.SprintFetch(sprint.SprintId); sprint.Name = DataHelper.RandomString(20); SprintService.SprintSave(sprint); } catch (Exception ex) { exception = ex; } Assert.IsTrue(exception != null, "Exception should not be null"); Assert.IsTrue(exception.GetBaseException() is SecurityException); }
public void Sprint_Delete() { var sprint = SprintService.SprintNew(); var project = BusinessHelper.CreateProject(); sprint.ProjectId = project.ProjectId; sprint.Name = DataHelper.RandomString(20); sprint = SprintService.SprintSave(sprint); sprint = SprintService.SprintFetch(sprint.SprintId); SprintService.SprintDelete(sprint.SprintId); try { SprintService.SprintFetch(sprint.SprintId); } catch (Exception ex) { Assert.IsTrue(ex.GetBaseException() is InvalidOperationException); } }