[Test] public void UnconfigurableExecutorServiceChokesOnNullArgument() { var e2 = Assert.Throws <ArgumentNullException>( () => Executors.UnconfigurableExecutorService(null)); Assert.That(e2.ParamName, Is.EqualTo("executor")); }
[Test] public void UnconfigurableExecutorServiceCanExecuteRunnables() { var e = Executors.UnconfigurableExecutorService(Executors.NewFixedThreadPool(2)); CanExecuteRunnable(e); JoinPool(e); }
[Test] public void UnconfigurableExecutorCannotBeCastedToConcreteImplementation() { var original = new ThreadPoolExecutor(1, 1, TimeSpan.Zero, new LinkedBlockingQueue <IRunnable>()); IExecutorService e = Executors.UnconfigurableExecutorService(original); Assert.That(e, Is.Not.InstanceOf <ThreadPoolExecutor>()); JoinPool(e); }