public async Task TestQueue()
        {
            Assert.Equal(0, _count);

            var queue = new CSharp.WorktrackingQueue<string, string>(
                i => new List<string> { i },
                DoWork,
                1000,
                1,
                Complete);

            await queue.Add("0something");
            await queue.Add("1something");
            await queue.Add("2something");
            await queue.Add("3something");
            await queue.Add("4something");
            await queue.Add("5something");
            await queue.Add("6something");
            await queue.Add("7something");
            await queue.Add("8something");
            await queue.Add("9something");

            await queue.AsyncComplete();
            
            Assert.True(_count > 1, "Callback should have been made at least once");
        }
Esempio n. 2
0
        public async Task TestQueue()
        {
            Assert.Equal(0, _count);

            var queue = new CSharp.WorktrackingQueue <string, string>(
                i => new List <string> {
                i
            },
                DoWork,
                1000,
                1,
                Complete);

            await queue.Add("0something");

            await queue.Add("1something");

            await queue.Add("2something");

            await queue.Add("3something");

            await queue.Add("4something");

            await queue.Add("5something");

            await queue.Add("6something");

            await queue.Add("7something");

            await queue.Add("8something");

            await queue.Add("9something");

            await queue.AsyncComplete();

            Assert.True(_count > 1, "Callback should have been made at least once");
        }