コード例 #1
0
        public void AddProjectMember_DuplicateEmail()
        {
            var projectMemberService = new ProjectMemberService(_projectMemberRepository.Object, _projectRepository.Object, _userService.Object);
            var exception            = Record.ExceptionAsync(() => projectMemberService.AddProjectMember(1, "*****@*****.**", "New", "User", null, 1, "http://web"));

            Assert.IsType <DuplicateUserEmailException>(exception?.Result);
        }
コード例 #2
0
        public void AddProjectMember_NewUserInvalidProject()
        {
            var projectMemberService = new ProjectMemberService(_projectMemberRepository.Object, _projectRepository.Object, _userService.Object);
            var exception            = Record.ExceptionAsync(() => projectMemberService.AddProjectMember(2, 2, 1));

            Assert.IsType <ProjectNotFoundException>(exception?.Result);
        }
コード例 #3
0
        public async void AddProjectMember_ValidItem()
        {
            var projectMemberService = new ProjectMemberService(_projectMemberRepository.Object, _projectRepository.Object, _userService.Object);
            var id = await projectMemberService.AddProjectMember(1, 2, 1);

            Assert.True(_data.Count > 1);
            Assert.True(id > 1);
        }
コード例 #4
0
        public async void AddProjectMember_NewUser()
        {
            var projectMemberService = new ProjectMemberService(_projectMemberRepository.Object, _projectRepository.Object, _userService.Object);

            var(memberId, userId) = await projectMemberService.AddProjectMember(1, "*****@*****.**", "New", "User", null, 1, "http://web");

            Assert.True(_data.Count > 1);
            Assert.True(memberId > 1);
            Assert.True(userId > 1);
        }
コード例 #5
0
        public async void AddProjectMember_DuplicateItem()
        {
            var projectMemberService = new ProjectMemberService(_projectMemberRepository.Object, _projectRepository.Object, _userService.Object);
            var id = await projectMemberService.AddProjectMember(1, 1, 2);

            var member = _data.First(d => d.ProjectId == 1 && d.UserId == 1);

            Assert.True(_data.Count == 1);
            Assert.Equal(1, id);
            Assert.Equal(2, member.ProjectMemberRoleId);
        }