Пример #1
0
        public async Task GetRealmRoleMappingToGroupWithID()
        {
            var newGroup = new Group.Models.Group()
            {
                Name = "groupClientRolsTest"
            };

            var res = await client.Realms().Name("master").Groups().CreateAsync(newGroup);

            res.Success.Should().BeTrue();
        }
Пример #2
0
        public async Task CreateNewUser()
        {
            var newGroup = new Group.Models.Group
            {
                Name = "testGroup"
            };
            var res = await client.Realms().Name("master").Groups().CreateAsync(newGroup);

            res.Success.Should().BeTrue("The creation result should be true");
            res.Id.Should().HaveLength(36, "The returned Id should have a length of 36");
        }
Пример #3
0
        public async Task UpdateGroup()
        {
            var group = await client.Realms().Name("master").Groups().FindAsync(new GroupFilter()
            {
                Search = "testGroup"
            });

            group.Should().HaveCount(1, "The group should be easily found");
            group.First().Id.Should().NotBeNull("Did the new group creation test run successfully???");

            var groupID = group.First().Id;

            var updatedGroup = new Group.Models.Group
            {
                Name = "updatedGroup"
            };

            var res = await client.Realms().Name("master").Groups().Id(groupID).UpdateAsync(updatedGroup);

            res.Should().BeTrue("The update result should be true");
        }
Пример #4
0
        public async Task GetRealmRoleMappingToGroupWithID()
        {
            var newGroup = new Group.Models.Group()
            {
                Name = "groupRealmRolsTest"
            };

            var res = await client.Realms().Name("master").Groups().CreateAsync(newGroup);

            res.Success.Should().BeTrue();

            var group = await client.Realms().Name("master").Groups().FindAsync(new Group.Models.GroupFilter()
            {
                Search = "groupRealmRolsTest"
            });

            var mapping = await client.Realms().Name("master").Groups().Id(group.First().Id).Roles().GetAsync();

            mapping.RealmMappings.Should().BeNull("By default there are no mapings");
            mapping.ClientMappings.Should().BeNull("By default there are no mapings");
        }