public void Dispose_Success()
		{
			FailableScheduledAction action = new FailableScheduledAction(FailableScheduledAction.DummyAction.Run);
			Assert.IsFalse(action.IsDisposedTest);
			action.Dispose();
			Assert.IsTrue(action.IsDisposedTest);
			action.Dispose();
		}
예제 #2
0
        public void Dispose_Success()
        {
            FailableScheduledAction action = new FailableScheduledAction(FailableScheduledAction.DummyAction.Run);

            Assert.IsFalse(action.IsDisposedTest);
            action.Dispose();
            Assert.IsTrue(action.IsDisposedTest);
            action.Dispose();
        }
        public void Dispose_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);

            task.Dispose();

            CustomAssert.ThrowsException <ObjectDisposedException>(() =>
            {
                FailableScheduledAction action = task.Action;
            });

            task.Dispose();
        }
		public void XmlSerializable_Success()
		{
			FailableScheduledAction action = new FailableScheduledAction(FailableScheduledAction.DummyAction.ThrowException);
			Assert.IsNull(((IXmlSerializable)action).GetSchema());
			using (XmlWriter writer = XmlWriter.Create(new MemoryStream()))
			{
				writer.WriteStartElement("action");
				action.WriteXml(writer);
				writer.WriteEndElement();
			}

			action = new FailableScheduledAction();
			using (XmlReader reader = XmlReader.Create(new StringReader("<?xml version=\"1.0\" encoding=\"utf-8\" ?><action behavior=\"ThrowException\" />")))
			{
				reader.ReadToFollowing("action");
				action.ReadXml(reader);
			}
		}
예제 #5
0
        public void XmlSerializable_Success()
        {
            FailableScheduledAction action = new FailableScheduledAction(FailableScheduledAction.DummyAction.ThrowException);

            Assert.IsNull(((IXmlSerializable)action).GetSchema());
            using (XmlWriter writer = XmlWriter.Create(new MemoryStream()))
            {
                writer.WriteStartElement("action");
                action.WriteXml(writer);
                writer.WriteEndElement();
            }

            action = new FailableScheduledAction();
            using (XmlReader reader = XmlReader.Create(new StringReader("<?xml version=\"1.0\" encoding=\"utf-8\" ?><action behavior=\"ThrowException\" />")))
            {
                reader.ReadToFollowing("action");
                action.ReadXml(reader);
            }
        }
		public void Ctor_Success()
		{
			FailableScheduledAction action = new FailableScheduledAction(FailableScheduledAction.DummyAction.Run);
		}
예제 #7
0
 public void Ctor_Success()
 {
     FailableScheduledAction action = new FailableScheduledAction(FailableScheduledAction.DummyAction.Run);
 }