コード例 #1
0
        public void ReassignTeam()
        {
            Project.Private = true;
            Project         = ProjectEngine.SaveOrUpdate(Project, false);
            ProjectEngine.SetTeamSecurity(Project, From,
                                          ProjectTeamSecurity.Contacts |
                                          ProjectTeamSecurity.Files |
                                          ProjectTeamSecurity.Messages |
                                          ProjectTeamSecurity.Milestone |
                                          ProjectTeamSecurity.Tasks);

            ProjectsReassign.Reassign(From, To);

            var team = ProjectEngine.GetTeam(Project.ID).Select(r => r.ID).ToList();

            Assert.That(team, Has.No.Member(From));
            Assert.That(team, Has.Member(To));

            var security = ProjectEngine.GetTeamSecurity(Project, To);

            Assert.That(security & ProjectTeamSecurity.Tasks, Is.EqualTo(ProjectTeamSecurity.Tasks));
            Assert.That(security & ProjectTeamSecurity.Contacts, Is.EqualTo(ProjectTeamSecurity.Contacts));
            Assert.That(security & ProjectTeamSecurity.Files, Is.EqualTo(ProjectTeamSecurity.Files));
            Assert.That(security & ProjectTeamSecurity.Messages, Is.EqualTo(ProjectTeamSecurity.Messages));
            Assert.That(security & ProjectTeamSecurity.Milestone, Is.EqualTo(ProjectTeamSecurity.Milestone));
        }
コード例 #2
0
ファイル: BaseTest.cs プロジェクト: ztcyun/CommunityServer
 protected List <Guid> GetTeam(int projectId)
 {
     return(ProjectEngine.GetTeam(projectId).Select(r => r.ID).ToList());
 }