public void AsynchWorkerCallbackShouldReturn9720516145911357709If5000Range()
        {
            var expectedOutput = 9720516145911357709ul;
            var asynchImpl = new AsynchFibonacciWorker(5000);

            asynchImpl.AsynchWorkerCallback();

            Assert.AreEqual(expectedOutput, asynchImpl.CalculatedFibonacciNumber);
        }
        public void AsynchWorkerCallbackShouldReturnZeroIfZeroRange()
        {
            var expectedOutput = 0ul;
            var asynchImpl = new AsynchFibonacciWorker(0);

            asynchImpl.AsynchWorkerCallback();

            Assert.AreEqual(expectedOutput, asynchImpl.CalculatedFibonacciNumber);
        }
Exemplo n.º 3
0
        void InitializeWorkerPool(ulong sequenceRange)
        {
            AsynchFibonacciWorkers = new AsynchFibonacciWorker[sequenceRange];
            AsynchCompletedTasks = new Task[sequenceRange];

            for (ulong i = 0ul; i < sequenceRange; i++)
            {
                AsynchFibonacciWorker worker = new AsynchFibonacciWorker(i+1);
                AsynchFibonacciWorkers[i] = worker;
            }
        }