Ejemplo n.º 1
0
        private void CreateTeamWithMember()
        {
            var teamMember = new Data.TeamMember()
            {
                UserId = "TestUser"
            };
            var team = new Data.Team()
            {
                Id = 0
            };

            team.TeamMembers.Add(teamMember);
            teamMember.Team = team;
            _mockContainer.Teams.Add(team);
            _mockContainer.TeamMembers.Add(teamMember);
        }
Ejemplo n.º 2
0
 private void CreateTeamAndTeamMember(out Data.Team team, out Data.TeamMember teamMember)
 {
     team = new Data.Team()
     {
         Id = 1
     };
     teamMember = new Data.TeamMember()
     {
         UserId = TestUser, Id = 1
     };
     teamMember.Team   = team;
     teamMember.TeamId = team.Id;
     team.TeamMembers.Add(teamMember);
     _mockContainer.Teams.Add(team);
     _mockContainer.TeamMembers.Add(teamMember);
 }
Ejemplo n.º 3
0
        public void AddUserToTeam(int id, TeamMember member)
        {
            Data.TeamMember teamMember = null;

            var team = _teamRepo.FindById(id);
            if (team.TeamMembers.Any(i => i.UserId == member.EmailAddress))
            {
                teamMember = team.TeamMembers.Where(i => i.UserId == member.EmailAddress).First();
            }
            else
            {
                teamMember = new Data.TeamMember() { UserId = member.EmailAddress };
                team.TeamMembers.Add(teamMember);
            }

            teamMember.IsAdmin = member.IsAdmin;

            _teamRepo.SaveChanges();
        }
Ejemplo n.º 4
0
        public void AddUserToTeam(int id, TeamMember member)
        {
            Data.TeamMember teamMember = null;

            var team = _teamRepo.FindById(id);

            if (team.TeamMembers.Any(i => i.UserId == member.EmailAddress))
            {
                teamMember = team.TeamMembers.Where(i => i.UserId == member.EmailAddress).First();
            }
            else
            {
                teamMember = new Data.TeamMember()
                {
                    UserId = member.EmailAddress
                };
                team.TeamMembers.Add(teamMember);
            }

            teamMember.IsAdmin = member.IsAdmin;

            _teamRepo.SaveChanges();
        }
Ejemplo n.º 5
0
 private void CreateTeamAndTeamMember(out Data.Team team, out Data.TeamMember teamMember)
 {
     team = new Data.Team() { Id = 1 };
     teamMember = new Data.TeamMember() { UserId = TestUser, Id = 1 };
     teamMember.Team = team;
     teamMember.TeamId = team.Id;
     team.TeamMembers.Add(teamMember);
     _mockContainer.Teams.Add(team);
     _mockContainer.TeamMembers.Add(teamMember);
 }
Ejemplo n.º 6
0
 private void CreateTeamWithMember()
 {
     var teamMember = new Data.TeamMember() { UserId = "TestUser" };
     var team = new Data.Team() { Id = 0 };
     team.TeamMembers.Add(teamMember);
     teamMember.Team = team;
     _mockContainer.Teams.Add(team);
     _mockContainer.TeamMembers.Add(teamMember);
 }