コード例 #1
0
        public async Task GetRoles()
        {
            IPlanGridApi api      = PlanGridClient.Create();
            var          allRoles = new List <Role>();
            int          offset   = 0;
            Page <Role>  roles    = await api.GetRoles(TestData.Project1Uid, offset, 1);

            while (roles.Data.Any())
            {
                offset++;
                allRoles.Add(roles.Data[0]);
                roles = await api.GetRoles(TestData.Project1Uid, offset, 1);
            }
            Assert.AreEqual(3, allRoles.Count);
        }
コード例 #2
0
        public async Task GetRole()
        {
            IPlanGridApi api   = PlanGridClient.Create();
            var          roles = await api.GetRoles(TestData.Project1Uid);

            Role role = await api.GetRole(TestData.Project1Uid, TestData.AdminRoleId);

            Assert.AreEqual("Admin", role.Label);
        }