예제 #1
0
        private List <Team> CreateTeams()
        {
            TeamController tc  = new TeamController();
            var            tnw = tc.Create("writer team", testContext.users[0]);

            tc.AddAdmin(tnw.Id, testContext.users[3].Id, testContext.users[0]);
            tc.AddReader(tnw.Id, testContext.users[4].Id, testContext.users[0]);


            var tnr = tc.Create("reader team", testContext.users[0]);

            tc.AddAdmin(tnr.Id, testContext.users[5].Id, testContext.users[0]);
            tc.AddReader(tnr.Id, testContext.users[6].Id, testContext.users[0]);

            var teams = new List <Team>();

            teams.Add(tnw);
            teams.Add(tnr);

            return(teams);
        }
예제 #2
0
        private Team CreateNestedTeam()
        {
            var team = controller.Create("team", testContext.users[0]);

            controller.AddAdmin(team.Id, testContext.users[1].Id, testContext.users[0]);
            controller.AddReader(team.Id, testContext.users[2].Id, testContext.users[0]);

            var tnw = controller.Create("nested writer", testContext.users[0]);

            controller.AddAdmin(tnw.Id, testContext.users[3].Id, testContext.users[0]);
            controller.AddReader(tnw.Id, testContext.users[4].Id, testContext.users[0]);
            controller.AddAdmin(team.Id, tnw.Id, testContext.users[0]);

            var tnr = controller.Create("nested reader", testContext.users[0]);

            controller.AddAdmin(tnr.Id, testContext.users[5].Id, testContext.users[0]);
            controller.AddReader(tnr.Id, testContext.users[6].Id, testContext.users[0]);
            controller.AddReader(team.Id, tnr.Id, testContext.users[0]);

            return(team);
        }