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()); } }
public void NullFunctionTesting() { Assert.Throws <ArgumentNullException> (() => LazyFactory <int> .CreateMultiThreadedLazy(null)); }