Ejemplo n.º 1
0
        public void TestSimpleCall()
        {
            int    value = 0;
            Action act   = () =>
            {
                value++;
            };

            var testInst = new ActionThreadPoolWorkItem(act);

            testInst.Run(false, false);

            Assert.AreEqual(1, value);
        }
Ejemplo n.º 2
0
        public void TestCallWithExecutionContext()
        {
            int    value = 0;
            Action act   = () =>
            {
                value++;
            };

            var testInst = new ActionThreadPoolWorkItem(act);

            testInst.CaptureExecutionContext(false);

            testInst.Run(true, true);

            Assert.AreEqual(1, value);
        }