コード例 #1
0
        public void AsynchWorkerCallbackShouldReturn9720516145911357709If5000Range()
        {
            var expectedOutput = 9720516145911357709ul;
            var asynchImpl = new AsynchFibonacciWorker(5000);

            asynchImpl.AsynchWorkerCallback();

            Assert.AreEqual(expectedOutput, asynchImpl.CalculatedFibonacciNumber);
        }
コード例 #2
0
        public void AsynchWorkerCallbackShouldReturnZeroIfZeroRange()
        {
            var expectedOutput = 0ul;
            var asynchImpl = new AsynchFibonacciWorker(0);

            asynchImpl.AsynchWorkerCallback();

            Assert.AreEqual(expectedOutput, asynchImpl.CalculatedFibonacciNumber);
        }
コード例 #3
0
ファイル: AsynchFibonacci.cs プロジェクト: GusLab/fibonacci
        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;
            }
        }