public async Task Managing_user_roles_should_work_properly_after_multiple_operations()
        {
            var userResult = await UserManagementApi.CreateUser(GetUniqueTestUser);

            var userData = userResult.Data.First();

            await LoadRoles();

            var roleRemoveResult = await UserManagementApi.RemoveUserFromRole(userData.Id, Role1.Id);

            var userRoles = await UserManagementApi.GetUserRoles(userData.Id);

            Assert.True(userResult.Success);
            Assert.True(roleRemoveResult.Success);
            Assert.Empty(userRoles.Data);
        }
        public async Task Adding_user_to_role_multiple_times_shouldnt_do_anything()
        {
            var userResult = await UserManagementApi.CreateUser(GetUniqueTestUser);

            var userData = userResult.Data.First();

            await LoadRoles();

            var role1AddResult = await UserManagementApi.AddUserToRole(userData.Id, Role1.Id);

            var role2AddResult = await UserManagementApi.AddUserToRole(userData.Id, Role1.Id);

            var userRoles = await UserManagementApi.GetUserRoles(userData.Id);

            Assert.True(userResult.Success);
            Assert.True(role1AddResult.Success);
            Assert.True(role2AddResult.Success);
            Assert.Single(userRoles.Data);
        }
        public async Task Adding_user_to_multiple_roles_should_work()
        {
            var userResult = await UserManagementApi.CreateUser(GetUniqueTestUser);

            var userData = userResult.Data.First();

            await LoadRoles();

            var roleAddResult1 = await UserManagementApi.AddUserToRole(userData.Id, Role1.Id);

            var roleAddResult2 = await UserManagementApi.AddUserToRole(userData.Id, Role2.Id);

            var userRoles = await UserManagementApi.GetUserRoles(userData.Id);

            Assert.True(userResult.Success);
            Assert.True(roleAddResult1.Success);
            Assert.True(roleAddResult2.Success);
            Assert.Equal(2, userRoles.Data.Count());
        }
        public async Task Removing_user_from_role_should_work()
        {
            var userResult = await UserManagementApi.CreateUser(GetUniqueTestUser);

            var userData = userResult.Data.First();

            await LoadRoles();

            var roleAddResult = await UserManagementApi.AddUserToRole(userData.Id, Role1.Id);

            var roleRemoveResult = await UserManagementApi.RemoveUserFromRole(userData.Id, Role1.Id);

            var userRoles = await UserManagementApi.GetUserRoles(userData.Id);

            Assert.True(userResult.Success);
            Assert.True(roleAddResult.Success);
            Assert.True(roleRemoveResult.Success);
            Assert.Empty(userRoles.Data);
        }
        public async Task Removing_user_from_unassigned_role_shouldnt_do_anything()
        {
            var userResult = await UserManagementApi.CreateUser(GetUniqueTestUser);

            var userData = userResult.Data.First();

            await LoadRoles();

            await UserManagementApi.AddUserToRole(userData.Id, Role1.Id);

            await UserManagementApi.AddUserToRole(userData.Id, Role2.Id);

            await UserManagementApi.AddUserToRole(userData.Id, Role2.Id);

            await UserManagementApi.RemoveUserFromRole(userData.Id, Role1.Id);

            await UserManagementApi.RemoveUserFromRole(userData.Id, Role2.Id);

            await UserManagementApi.AddUserToRole(userData.Id, Role2.Id);

            var userRoles = await UserManagementApi.GetUserRoles(userData.Id);

            Assert.Single(userRoles.Data);
        }