示例#1
0
        public static ProjectUser ProjectUserAdd()
        {
            var projectUserMember = ProjectUserTestHelper.ProjectUserNew();

            projectUserMember = ProjectUserRepository.ProjectUserSave(projectUserMember);

            return(projectUserMember);
        }
示例#2
0
        public void ProjectUser_Fetch()
        {
            var projectUserMember = ProjectUserTestHelper.ProjectUserNew();

            projectUserMember = ProjectUserRepository.ProjectUserSave(projectUserMember);

            projectUserMember = ProjectUserRepository.ProjectUserFetch(projectUserMember.ProjectUserMemberId);

            Assert.IsTrue(projectUserMember != null, "Row returned should not equal null");
        }
        public ActionResult Create(int projectId, int userId)
        {
            var model       = new ProjectUserFormModel();
            var projectUser = ProjectUserRepository.ProjectUserNew(projectId, userId);

            projectUser.RoleId = (int)Role.Collaborator;

            projectUser = ProjectUserRepository.ProjectUserSave(projectUser);

            return(this.RedirectToAction("Details", "Project", new { id = projectUser.ProjectId }));
        }
示例#4
0
        public void ProjectUser_Add()
        {
            var projectUserMember = ProjectUserTestHelper.ProjectUserNew();

            Assert.IsTrue(projectUserMember.IsValid, "IsValid should be true");

            projectUserMember = ProjectUserRepository.ProjectUserSave(projectUserMember);

            Assert.IsTrue(projectUserMember.ProjectUserMemberId != 0, "ProjectUserMemberId should be a non-zero value");

            ProjectUserRepository.ProjectUserFetch(projectUserMember.ProjectUserMemberId);
        }
示例#5
0
        public void ProjectUser_Edit()
        {
            var projectUserMember = ProjectUserTestHelper.ProjectUserNew();

            var roleId = projectUserMember.RoleId;

            Assert.IsTrue(projectUserMember.IsValid, "IsValid should be true");

            projectUserMember = ProjectUserRepository.ProjectUserSave(projectUserMember);

            projectUserMember = ProjectUserRepository.ProjectUserFetch(projectUserMember.ProjectUserMemberId);

            projectUserMember.RoleId = (int)Role.Reviewer;

            projectUserMember = ProjectUserRepository.ProjectUserSave(projectUserMember);

            projectUserMember = ProjectUserRepository.ProjectUserFetch(projectUserMember.ProjectUserMemberId);

            Assert.IsTrue(projectUserMember.RoleId != roleId, "RoleId should have different value");
        }
示例#6
0
        public void ProjectUser_Delete()
        {
            var projectUserMember = ProjectUserTestHelper.ProjectUserNew();

            Assert.IsTrue(projectUserMember.IsValid, "IsValid should be true");

            projectUserMember = ProjectUserRepository.ProjectUserSave(projectUserMember);

            projectUserMember = ProjectUserRepository.ProjectUserFetch(projectUserMember.ProjectUserMemberId);

            ProjectUserRepository.ProjectUserDelete(projectUserMember.ProjectUserMemberId);

            try
            {
                ProjectUserRepository.ProjectUserFetch(projectUserMember.ProjectUserMemberId);
            }
            catch (Exception ex)
            {
                Assert.IsTrue(ex.GetBaseException() is InvalidOperationException);
            }
        }