Пример #1
0
		public void CommandCallsFinalize()
		{
			TestCommand cmd = new TestCommand();
			cmd.Finish += new EventHandler(OnFinish);
			cmd.BeginInvoke();
			WaitOnBool(ref _onFinishCalled);
		}
Пример #2
0
        public void CommandCallsFinalize()
        {
            TestCommand cmd = new TestCommand();

            cmd.Finish += new EventHandler(OnFinish);
            cmd.BeginInvoke();
            WaitOnBool(ref _onFinishCalled);
        }
Пример #3
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 ?
		}
Пример #4
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 ?
        }