예제 #1
0
        public void Setup()
        {
            lazyMultiThreaded = LazyFactory <int> .CreateMultiThreadedLazy(() =>
            {
                for (int i = 0; i < 100000; i++)
                {
                    Interlocked.Increment(ref result);
                }
                return(result);
            });

            threads = new Thread[5];
            for (int i = 0; i < 5; i++)
            {
                threads[i] = new Thread(() => lazyMultiThreaded.Get());
            }
        }
예제 #2
0
 public void NullFunctionTesting()
 {
     Assert.Throws <ArgumentNullException> (() => LazyFactory <int> .CreateMultiThreadedLazy(null));
 }