Beispiel #1
0
        public void ProjectUser_Fetch_Info_List()
        {
            ProjectUserTestHelper.ProjectUserAdd();
            ProjectUserTestHelper.ProjectUserAdd();

            var projectUserMembers = ProjectUserRepository.ProjectUserFetchInfoList(new ProjectUserMemberDataCriteria());

            Assert.IsTrue(projectUserMembers.Count() > 1, "Row returned should be greater than one");
        }
Beispiel #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");
        }
Beispiel #3
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);
        }
Beispiel #4
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");
        }
Beispiel #5
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);
            }
        }