Ejemplo n.º 1
0
		public void CommandCanBeCancelled()
		{
			TestCommand cmd = new TestCommand();
			cmd.BeginInvoke();
			Thread.Sleep(10);
			Assert.IsFalse(cmd.Enabled);
			cmd.Cancel();
			Assert.IsTrue(cmd.Canceling);
			WaitOnBool(ref cmd.wasCancelled);
			//no: it doesn't do this            Assert.IsTrue(cmd.Enabled);

			//todo: I can't see a way to know that it ended, if you cancel it.
			//finish isn't called. Should it be ?
		}
Ejemplo n.º 2
0
        public void CommandCanBeCancelled()
        {
            TestCommand cmd = new TestCommand();

            cmd.BeginInvoke();
            Thread.Sleep(10);
            Assert.IsFalse(cmd.Enabled);
            cmd.Cancel();
            Assert.IsTrue(cmd.Canceling);
            WaitOnBool(ref cmd.wasCancelled);
            //no: it doesn't do this            Assert.IsTrue(cmd.Enabled);

            //todo: I can't see a way to know that it ended, if you cancel it.
            //finish isn't called. Should it be ?
        }