public void Sprint_Add() { var sprint = SprintService.SprintNew(); var project = BusinessHelper.CreateProject(); sprint.ProjectId = project.ProjectId; sprint.Name = DataHelper.RandomString(20); Assert.IsTrue(sprint.IsValid, "IsValid should be true"); SprintService.SprintSave(sprint); }
public static Sprint CreateSprint() { var sprint = SprintService.SprintNew(); var project = BusinessHelper.CreateProject(); sprint.ProjectId = project.ProjectId; sprint.Name = DataHelper.RandomString(20); sprint = SprintService.SprintSave(sprint); return(sprint); }
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_Add_With_Duplicate_Name() { var sprint = SprintService.SprintNew(); var project = BusinessHelper.CreateProject(); var name = DataHelper.RandomString(20); sprint.ProjectId = project.ProjectId; sprint.Name = name; SprintService.SprintSave(sprint); sprint = SprintService.SprintNew(); sprint.ProjectId = project.ProjectId; sprint.Name = name; Assert.IsTrue(ValidationHelper.ContainsRule(sprint, "rule://epiworx.business.sprintduplicatenamecheck/Name"), "Name should not be duplicated"); }
public void Sprint_Fetch_List() { var sprint = SprintService.SprintNew(); var project = BusinessHelper.CreateProject(); sprint.ProjectId = project.ProjectId; sprint.Name = DataHelper.RandomString(20); sprint = SprintService.SprintSave(sprint); sprint.ProjectId = project.ProjectId; sprint.Name = DataHelper.RandomString(20); SprintService.SprintSave(sprint); var sprints = SprintService.SprintFetchInfoList(); Assert.IsTrue(sprints.Count > 1, "Sprints should be greater than one"); }
public ActionResult Create(SprintFormModel model) { var sprint = SprintService.SprintNew(); Csla.Data.DataMapper.Map(model, sprint, true, "ProjectName"); sprint = SprintService.SprintSave(sprint); if (sprint.IsValid) { return(new JsonResult { Data = this.Url.Action("Edit", new { id = sprint.SprintId, message = Resources.SaveSuccessfulMessage }) }); } this.MapToModel(sprint, model, false); 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 static Sprint CreateSprintAndLogon(string userName, string userPassword) { var name = DataHelper.RandomString(20); var password = DataHelper.RandomString(20); BusinessHelper.CreateUserWithFullControl(name, password); BusinessPrincipal.Login(name, password); var sprint = SprintService.SprintNew(); var project = BusinessHelper.CreateProject(); sprint.ProjectId = project.ProjectId; sprint.Name = DataHelper.RandomString(20); sprint = SprintService.SprintSave(sprint); BusinessPrincipal.Logout(); BusinessPrincipal.Login(userName, userPassword); return(sprint); }
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); } }