Ejemplo n.º 1
0
        public void DoIoIntensiveOperationTest3()
        {
            CancellationTokenSource cts = new CancellationTokenSource();
            double            seconds   = 0.5F;
            CancellationToken token     = cts.Token;
            bool throwOnCancel          = true;
            bool actual;

            cts.Cancel();
            actual = Timing.DoIoIntensiveOperation(seconds, token, throwOnCancel);
        }
Ejemplo n.º 2
0
        public void DoIoIntensiveOperationTest1()
        {
            double            seconds = 1F;
            CancellationToken token   = new CancellationToken();
            bool throwOnCancel        = false;
            bool expected             = true;
            bool actual;

            actual = Timing.DoIoIntensiveOperation(seconds, token, throwOnCancel);
            Assert.AreEqual(expected, actual);
        }
Ejemplo n.º 3
0
        public void DoIoIntensiveOperationTest2()
        {
            CancellationTokenSource cts = new CancellationTokenSource();
            double            seconds   = 0.5F;
            CancellationToken token     = cts.Token;
            bool throwOnCancel          = false;
            bool actual;
            bool expected = false;

            cts.Cancel();
            actual = Timing.DoIoIntensiveOperation(seconds, token, throwOnCancel);
            Assert.AreEqual(expected, actual);
        }