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);
        }
示例#2
0
        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");
        }
示例#3
0
        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");
        }
示例#4
0
        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");
        }
示例#5
0
        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));
        }
示例#6
0
        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));
        }
示例#7
0
        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");
        }
示例#8
0
        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);
        }
示例#9
0
        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);
            }
        }