<commit_before>﻿using System.Threading.Tasks;
using FluentAssertions;
using VkLibrary.Tests.Helpers;
using Xunit;
using Xunit.Abstractions;

namespace VkLibrary.Tests
{
    public class LongPoll : ClassFixtureBase
    {
        public LongPoll(ITestOutputHelper testOutputHelper) : base(Constants.ApplicationId, 
            string.Empty, Constants.AccessToken, testOutputHelper) { }

        [Fact]
        public async void GetLongPollServer()
        {
            var response = await Api.Messages.GetLongPollServer();
            response.Should().NotBeNull();
            
            response.Key.Should().NotBeNullOrEmpty();
            response.Server.Should().NotBeNullOrEmpty();
            response.Ts.Should().BeGreaterThan(0);
        }

        [Fact]
        public async void StartLongPollSever()
        {
            var response = await Api.Messages.GetLongPollServer();
            var client = await Api.StartLongPollClient(
                response.Server, response.Key, response.Ts);
            
            var success = false;
            client.ResponseReceived += (sender, args) => success = true;
            await Task.Delay(30000);
            client.Stop();
            success.Should().BeTrue();
        }
    }
}<commit_msg>fix: longpoll test used to parse Ts parameter as int<commit_after>﻿using System.Threading.Tasks;
using FluentAssertions;
using VkLibrary.Tests.Helpers;
using Xunit;
using Xunit.Abstractions;

namespace VkLibrary.Tests
{
    public class LongPoll : ClassFixtureBase
    {
        public LongPoll(ITestOutputHelper testOutputHelper) : base(Constants.ApplicationId, 
            string.Empty, Constants.AccessToken, testOutputHelper) { }

        [Fact]
        public async void GetLongPollServer()
        {
            var response = await Api.Messages.GetLongPollServer();
            response.Should().NotBeNull();
            
            response.Key.Should().NotBeNullOrEmpty();
            response.Server.Should().NotBeNullOrEmpty();
            response.Ts.Should().NotBe("0");
        }

        [Fact]
        public async void StartLongPollSever()
        {
            var response = await Api.Messages.GetLongPollServer();
            var client = await Api.StartLongPollClient(
                response.Server, response.Key, int.Parse(response.Ts));
            
            var success = false;
            client.ResponseReceived += (sender, args) => success = true;
            await Task.Delay(30000);
            client.Stop();
            success.Should().BeTrue();
        }
    }
}
{'fraction_non_alphanumeric': 0.09992193598750976, 'fraction_numerical': 0.00468384074941452, 'mean_word_length': 2.1525215252152523, 'pattern_counts': {'":': 0, '<': 3, '<?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': '3920796', 'n_tokens_mistral': 690, 'n_tokens_neox': 682, 'n_words': 137}