<commit_before>﻿using System.Threading.Tasks;
using FluentAssertions;
using Picturepark.SDK.V1.Contract;
using Xunit;
using Picturepark.SDK.V1.Tests.Fixtures;

namespace Picturepark.SDK.V1.Tests.Clients
{
    public class ProfileTests : IClassFixture<ClientFixture>
    {
        private readonly PictureparkClient _client;

        public ProfileTests(ClientFixture fixture)
        {
            _client = fixture.Client;
        }

        [Fact]
        [Trait("Stack", "Profile")]
        public async Task ShouldGetProfile()
        {
            // Act
            var profile = await _client.Profile.GetAsync().ConfigureAwait(false);

            // Assert
            profile.Should().NotBeNull();
            profile.Id.Should().NotBeNullOrEmpty();
            profile.UserRights.Should().NotBeNull().And.Subject.Should().Contain(UserRight.ManageCollections);
            profile.UserRoleIds.Should().NotBeNull().And.NotBeEmpty();
        }

        [Fact]
        [Trait("Stack", "Profile")]
        public async Task ShouldUpdateProfile()
        {
            // Arrange
            var profile = await _client.Profile.GetAsync().ConfigureAwait(false);

            // Act
            var updateRequest = new UserProfileUpdateRequest
            {
                Id = profile.Id,
                Address = profile.Address,
                EmailAddress = profile.EmailAddress,
                FirstName = profile.FirstName + "1",
                LanguageCode = profile.LanguageCode,
                LastName = profile.LastName
            };

            var updatedProfile = await _client.Profile.UpdateAsync(updateRequest).ConfigureAwait(false);

            // Assert
            Assert.Equal(profile.FirstName + "1", updatedProfile.FirstName);
        }
    }
}
<commit_msg>Profile test updated<commit_after>﻿using System.Threading.Tasks;
using FluentAssertions;
using Picturepark.SDK.V1.Contract;
using Xunit;
using Picturepark.SDK.V1.Tests.Fixtures;

namespace Picturepark.SDK.V1.Tests.Clients
{
    public class ProfileTests : IClassFixture<ClientFixture>
    {
        private readonly PictureparkClient _client;

        public ProfileTests(ClientFixture fixture)
        {
            _client = fixture.Client;
        }

        [Fact]
        [Trait("Stack", "Profile")]
        public async Task ShouldGetProfile()
        {
            // Act
            var profile = await _client.Profile.GetAsync().ConfigureAwait(false);

            // Assert
            profile.Should().NotBeNull();
            profile.Id.Should().NotBeNullOrEmpty();
            profile.UserRights.Should().NotBeNull().And.Subject.Should().Contain(UserRight.ManageCollections);
            profile.UserRoleIds.Should().NotBeNull().And.NotBeEmpty();
        }

        [Fact]
        [Trait("Stack", "Profile")]
        public async Task ShouldUpdateProfile()
        {
            // Arrange
            var profile = await _client.Profile.GetAsync().ConfigureAwait(false);

            // Act
            var updateRequest = new UserProfileUpdateRequest
            {
                Id = profile.Id,
                Address = profile.Address,
                EmailAddress = profile.EmailAddress,
                FirstName = profile.FirstName + "1",
                LanguageCode = profile.LanguageCode,
                LastName = profile.LastName
            };

            var updatedProfile = await _client.Profile.UpdateAsync(updateRequest).ConfigureAwait(false);

            // Assert
            updatedProfile.FirstName.Should().Be(profile.FirstName + "1");
        }
    }
}

{'fraction_non_alphanumeric': 0.10203512684694731, 'fraction_numerical': 0.0027878449958182324, 'mean_word_length': 1.967741935483871, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4038448', 'n_tokens_mistral': 939, 'n_tokens_neox': 908, 'n_words': 161}