<commit_before>﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Distribox.Network.Schedule
{
    using System.Threading;
    using Distribox.CommonLib;
    using Distribox.FileSystem;
    using NUnit.Framework;

    [TestFixture]
    class RequestManagerTest
    {
        [Test]
        public void BasicFlow()
        {
            RequestManager manager = new RequestManager();

            FileEvent e1 = new FileEvent(); e1.EventId = "1"; e1.Size = 5 * 1024;
            FileEvent e2 = new FileEvent(); e2.EventId = "2";
            Peer p1 = new Peer(); p1.Port = 1111;
            Peer p2 = new Peer(); p2.Port = 2222;

            // No request yet
            Assert.IsNull(manager.GetRequests());

            // Add a request
            List<FileEvent> l1 = new List<FileEvent>(); l1.Add(e1);
            manager.AddRequests(l1, p1);

            // Check
            var tlp = manager.GetRequests();
            Assert.IsNotNull(tlp);
            Assert.IsTrue(Enumerable.SequenceEqual(tlp.Item1, l1));
            Assert.AreEqual(tlp.Item2, p1);

            // No request<commit_msg>Coding style<commit_after>﻿namespace Distribox.Network.Schedule
{
    using System.Threading;
    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Text;
    using Distribox.CommonLib;
    using Distribox.FileSystem;
    using NUnit.Framework;

    [TestFixture]
    class RequestManagerTest
    {
        [Test]
        public void BasicFlow()
        {
            RequestManager manager = new RequestManager();

            FileEvent e1 = new FileEvent(); e1.EventId = "1"; e1.Size = 5 * 1024;
            FileEvent e2 = new FileEvent(); e2.EventId = "2";
            Peer p1 = new Peer(); p1.Port = 1111;
            Peer p2 = new Peer(); p2.Port = 2222;

            // No request yet
            Assert.IsNull(manager.GetRequests());

            // Add a request
            List<FileEvent> l1 = new List<FileEvent>(); l1.Add(e1);
            manager.AddRequests(l1, p1);

            // Check
            var tlp = manager.GetRequests();
            Assert.IsNotNull(tlp);
            Assert.IsTrue(Enumerable.SequenceEqual(tlp.Item1, l1));
            Assert.AreEqual(tlp.Item2, p1);

            // No request
{'fraction_non_alphanumeric': 0.11005199306759099, 'fraction_numerical': 0.02859618717504333, 'mean_word_length': 1.9339263024142312, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, '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': '3396597', 'n_tokens_mistral': 708, 'n_tokens_neox': 677, 'n_words': 162}