<commit_before><commit_msg>Add Retry Test(not done yet)<commit_after>﻿using NUnit.Framework;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Unosquare.Swan.Components;
using Unosquare.Swan.Networking;

namespace Unosquare.Swan.Test
{
    [TestFixture]
    public class ComponentsRetryTest
    {
        private static int count = 0;

        [Test]
        public async Task RetryTest()
        {
            var retryCount = 4;
            await Retry.Do(FailFunction, TimeSpan.FromSeconds(1), retryCount);
            Assert.IsTrue(count == retryCount);
        }

        internal async Task FailFunction()
        {
            count++;
            var token = await JsonClient.GetString("http://accesscore.azurewebsites.net/api/token");
        }
    }
}
{'fraction_non_alphanumeric': 0.09828009828009827, 'fraction_numerical': 0.0036855036855036856, 'mean_word_length': 2.558951965065502, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '2133282', 'n_tokens_mistral': 236, 'n_tokens_neox': 235, 'n_words': 52}