Example #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);
        }
Example #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);
        }
Example #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);
        }