Esempio n. 1
0
        public void TestThread()
        {
            Account account = NewAccount6();
            var     errors  = new ConcurrentBag <Exception>();

            try
            {
                Thread[] threads = new Thread[_numberOfThreads];

                AccessTest accessTest = new AccessTest();

                for (int i = 0; i < _numberOfThreads; i++)
                {
                    Thread thread = new Thread(() =>
                    {
                        Run(accessTest.GetAccount, errors);
                    });
                    threads[i] = thread;
                }
                for (int i = 0; i < _numberOfThreads; i++)
                {
                    threads[i].Start();
                }
            }
            finally
            {
            }

            if (errors.Any())
            {
                throw new AggregateException(errors);
            }
        }
Esempio n. 2
0
        public void TestThread()
        {
            Account account = NewAccount6();

            try
            {
                Thread[] threads = new Thread[_numberOfThreads];

                AccessTest accessTest = new AccessTest();

                for (int i = 0; i < _numberOfThreads; i++)
                {
                    Thread thread = new Thread(new ThreadStart(accessTest.GetAccount));
                    threads[i] = thread;
                }
                for (int i = 0; i < _numberOfThreads; i++)
                {
                    threads[i].Start();
                }
            }
            finally
            {
            }
        }
Esempio n. 3
0
        public void TestThread()
        {
            Account account = NewAccount6();

            try
            {
                Thread[] threads = new Thread[_numberOfThreads];

                AccessTest accessTest = new AccessTest();

                for (int i = 0; i < _numberOfThreads; i++)
                {
                    Thread thread = new Thread(new ThreadStart(accessTest.GetAccount));
                    threads[i] = thread;
                }
                for (int i = 0; i < _numberOfThreads; i++)
                {
                    threads[i].Start();
                }
            }
            finally
            {
            }
        }