public void Ctor_TaskNull_Error()
		{
			ScheduledTask<FailableScheduledAction> task = null;

			CustomAssert.ThrowsException<CodedArgumentNullException>(() =>
			{
				ScheduledTaskStartingEventArgs<FailableScheduledAction> e = new ScheduledTaskStartingEventArgs<FailableScheduledAction>(task);
			});
		}
Exemple #2
0
        public void Ctor_TaskNull_Error()
        {
            ScheduledTask <FailableScheduledAction> task = null;

            CustomAssert.ThrowsException <CodedArgumentNullException>(() =>
            {
                ScheduledTaskStartingEventArgs <FailableScheduledAction> e = new ScheduledTaskStartingEventArgs <FailableScheduledAction>(task);
            });
        }
		public void Ctor_Success()
		{
			DateTimeOffset now = new DateTimeOffset(2013, 6, 1, 12, 0, 0, 0, TimeSpan.Zero);
			DateTimeOffset now2 = new DateTimeOffset(2013, 6, 1, 12, 0, 1, 0, TimeSpan.Zero);
			ScheduledTask<FailableScheduledAction> task = new ScheduledTask<FailableScheduledAction>(Schedule.CreateOneTime(now), new FailableScheduledAction(FailableScheduledAction.DummyAction.Run), true, now, now2);

			ScheduledTaskStartingEventArgs<FailableScheduledAction> e = new ScheduledTaskStartingEventArgs<FailableScheduledAction>(task);

			Assert.AreSame(task, e.Task);
			Assert.IsFalse(e.Cancel);
			e.Cancel = true;
			Assert.IsTrue(e.Cancel);
		}
Exemple #4
0
        public void Ctor_Success()
        {
            DateTimeOffset now  = new DateTimeOffset(2013, 6, 1, 12, 0, 0, 0, TimeSpan.Zero);
            DateTimeOffset now2 = new DateTimeOffset(2013, 6, 1, 12, 0, 1, 0, TimeSpan.Zero);
            ScheduledTask <FailableScheduledAction> task = new ScheduledTask <FailableScheduledAction>(Schedule.CreateOneTime(now), new FailableScheduledAction(FailableScheduledAction.DummyAction.Run), true, now, now2);

            ScheduledTaskStartingEventArgs <FailableScheduledAction> e = new ScheduledTaskStartingEventArgs <FailableScheduledAction>(task);

            Assert.AreSame(task, e.Task);
            Assert.IsFalse(e.Cancel);
            e.Cancel = true;
            Assert.IsTrue(e.Cancel);
        }