Beispiel #1
0
        public void RunSynchronouslyTaskStatusTest()
        {
            var ts = new LazyCatScheduler();
            var t  = new Task(() => { });

            try {
                t.RunSynchronously(ts);
            } catch {}
            Assert.AreEqual(TaskStatus.WaitingToRun, ts.ExecuteInlineStatus);
        }
Beispiel #2
0
        public void RunSynchronouslyButNoExecutionTest()
        {
            TaskSchedulerException ex = null;

            var  ts = new LazyCatScheduler();
            Task t  = new Task(() => {});

            try {
                t.RunSynchronously(ts);
            } catch (TaskSchedulerException e) {
                ex = e;
            }

            Assert.IsNotNull(ex);
            Assert.IsNotNull(ex.InnerException);
            Assert.IsInstanceOfType(typeof(InvalidOperationException), ex.InnerException);
        }
Beispiel #3
0
		public void RunSynchronouslyButNoExecutionTest ()
		{
			TaskSchedulerException ex = null;

			var ts = new LazyCatScheduler ();
			Task t = new Task (() => {});

			try {
				t.RunSynchronously (ts);
			} catch (TaskSchedulerException e) {
				ex = e;
			}

			Assert.IsNotNull (ex);
			Assert.IsNotNull (ex.InnerException);
			Assert.IsInstanceOfType (typeof (InvalidOperationException), ex.InnerException);
		}
		public void RunSynchronouslyTaskStatusTest ()
		{
			var ts = new LazyCatScheduler ();
			var t = new Task (() => { });

			try {
				t.RunSynchronously (ts);
			} catch {}
			Assert.AreEqual (TaskStatus.WaitingToRun, ts.ExecuteInlineStatus);
		}