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); }
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); }
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); }
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); }
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); }