public void Sprint_New() { Exception exception = null; try { SprintService.SprintNew(); } catch (Exception ex) { exception = ex; } Assert.IsTrue(exception != null, "Exception should not be null"); Assert.IsTrue(exception.GetBaseException() is SecurityException); }
public void Sprint_New() { var sprint = SprintService.SprintNew(); Assert.IsTrue(sprint.IsNew, "IsNew should be true"); Assert.IsTrue(sprint.IsDirty, "IsDirty should be true"); Assert.IsFalse(sprint.IsValid, "IsValid should be false"); Assert.IsTrue(sprint.IsSelfDirty, "IsSelfDirty should be true"); Assert.IsFalse(sprint.IsSelfValid, "IsSelfValid should be false"); Assert.IsTrue(sprint.IsActive, "IsActive should be true"); Assert.IsFalse(sprint.IsArchived, "IsArchived should be false"); Assert.IsTrue(ValidationHelper.ContainsRule(sprint, DbType.String, "Name"), "Name should be required"); Assert.IsTrue(ValidationHelper.ContainsRule(sprint, DbType.Int32, "ProjectId"), "ProjectId should be required"); }
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 ActionResult Create(int projectId) { var model = new SprintFormModel(); try { var sprint = SprintService.SprintNew(); sprint.ProjectId = projectId; 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 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_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); } }