Пример #1
0
        public void GetService_MultipleThreads_DoesNotThrowInvalidScopeException()
        {
            var container = CreateContainer();

            container.Register <IFoo, Foo>(new PerScopeLifetime());
            IDependencyResolver resolver = new LightInjectWebApiDependencyResolver(container);

            ParallelInvoker.Invoke(10, () => GetFooWithinScope(resolver));
        }
Пример #2
0
 public void GetInstance_MultipleThreads_DoesNotThrowException()
 {
     ParallelInvoker.Invoke(10, () => GetInstanceWithinWebRequest());
 }
Пример #3
0
 public void ShouldHandleMultipleThreads()
 {
     ParallelInvoker.Invoke(10, () => GetInstanceWithinWebRequest());
 }
Пример #4
0
        public void TryAdd_CanHandleMultipleThreads()
        {
            var dictionary = new ThreadSafeDictionary <string, string>();

            ParallelInvoker.Invoke(50, Add(dictionary), Remove(dictionary));
        }