AjErl.Tests.Functions.SpawnFunctionTests.SpawnSimpleProcess C# (CSharp) Méthode

SpawnSimpleProcess() private méthode

private SpawnSimpleProcess ( ) : void
Résultat void
        public void SpawnSimpleProcess()
        {
            AutoResetEvent handle = new AutoResetEvent(false);
            int count = 0;
            IFunction func = new SpawnFunction();
            IFunction lambda = new LambdaFunction(() => { count = 1; return handle.Set(); });

            var result = func.Apply(null, new object[] { lambda });

            Assert.IsNotNull(result);
            Assert.IsInstanceOfType(result, typeof(Process));

            handle.WaitOne();

            Assert.AreEqual(1, count);
        }
SpawnFunctionTests