示例#1
0
 public void TestOverloadedValid()
 {
     EnqueueCompleteIfEtcIsNull(delegate()
     {
         Assert.Throws(delegate() { etc = new EventTestCanvas(this, "Event_OverloadedValid.xaml"); }, typeof(XamlParseException));
     });
 }
示例#2
0
 public void TestCaseMismatch()
 {
     EnqueueCompleteIfEtcIsNull(delegate()
     {
         Assert.Throws(delegate() { etc = new EventTestCanvas(this, "Event_CaseMismatch.xaml"); }, typeof(XamlParseException));
     });
 }
示例#3
0
 public void TestExact_CaseMismatch()
 {
     EnqueueCompleteIfEtcIsNull(delegate()
     {
         // Case doesn't matter. VS always embeds resources in lowercase
         Assert.Throws <XamlParseException>(delegate() { etc = new EventTestCanvas(this, "event_exactcasemismatch.xaml"); });
     });
 }
示例#4
0
 public void TestExDerived3()
 {
     EnqueueCompleteIfThrows(delegate()
     {
         etc = new EventTestCanvas(this, "Event_Ex_Derived3.xaml");
         Assert.AreEqual(123, etc.Width);
     });
 }
示例#5
0
 public void TestRoutedEventArgs()
 {
     EnqueueCompleteIfThrows(delegate()
     {
         etc = new EventTestCanvas(this, "Event_RoutedEventArgs.xaml");
         etc.StartTimeout();
         Assert.AreEqual(123, etc.Width);
     });
 }
示例#6
0
 public void TestBasic()
 {
     EnqueueCompleteIfThrows(delegate()
     {
         etc = new EventTestCanvas(this, "Event_Basic.xaml");
         etc.StartTimeout();
         //Assert.AreEqual (123, etc.Width);
     });
 }
示例#7
0
文件: EventTest.cs 项目: dfr0/moon
		public void TestBasic ()
		{
			EnqueueCompleteIfThrows (delegate ()
			{
				etc = new EventTestCanvas (this, "Event_Basic.xaml");
				etc.StartTimeout ();
				//Assert.AreEqual (123, etc.Width);
			});
		}
示例#8
0
 public void TestInexistentResource()
 {
     // Note "moon_unit" instead of "moon-unit"
     // this isn't supposed to neither throw an exception (this xaml file should throw an exception), nor load anything at all
     EnqueueCompleteIfThrows(delegate()
     {
         etc = new EventTestCanvas(this, new Uri("/moon_unit;component/misc/Events/Event_InexistentResource.xaml", UriKind.Relative));
         Assert.AreNotEqual(123, etc.Width);
         EnqueueTestComplete();
     });
 }
示例#9
0
文件: EventTest.cs 项目: dfr0/moon
		private void EnqueueCompleteIfThrows (Action action)
		{
			try {
				etc = null;
				action ();
			} catch (Exception ex){
				Console.WriteLine ("EnqueueCompleteIfThrows: {0}", ex.Message);
				if (etc != null)
					etc.Done = true;
				EnqueueTestComplete ();
				throw;
			}
		}
示例#10
0
 private void EnqueueCompleteIfThrows(Action action)
 {
     try {
         etc = null;
         action();
     } catch (Exception ex) {
         Console.WriteLine("EnqueueCompleteIfThrows: {0}", ex.Message);
         if (etc != null)
         {
             etc.Done = true;
         }
         EnqueueTestComplete();
         throw;
     }
 }
示例#11
0
文件: EventTest.cs 项目: dfr0/moon
		private void EnqueueCompleteIfEtcIsNull (Action action)
		{
			try {
				Console.WriteLine ("EnqueueCompleteIfEtcIsNull");
				etc = null;
				action ();
			} catch (Exception ex) {
				Console.WriteLine ("EnqueueCompleteIfEtcIsNull: {0}", ex.Message);
				throw;
			} finally {
				if (etc == null) {
					Console.WriteLine ("EnqueueCompleteIfEtcIsNull: EnqueueTestComplete ()");
					EnqueueTestComplete ();
				} else {
					etc.StartTimeout ();
					Console.WriteLine ("EnqueueCompleteIfEtcIsNull [Done]");
				}
			}
		}
示例#12
0
 private void EnqueueCompleteIfEtcIsNull(Action action)
 {
     try {
         Console.WriteLine("EnqueueCompleteIfEtcIsNull");
         etc = null;
         action();
     } catch (Exception ex) {
         Console.WriteLine("EnqueueCompleteIfEtcIsNull: {0}", ex.Message);
         throw;
     } finally {
         if (etc == null)
         {
             Console.WriteLine("EnqueueCompleteIfEtcIsNull: EnqueueTestComplete ()");
             EnqueueTestComplete();
         }
         else
         {
             etc.StartTimeout();
             Console.WriteLine("EnqueueCompleteIfEtcIsNull [Done]");
         }
     }
 }
示例#13
0
文件: EventTest.cs 项目: dfr0/moon
		public void MarkTestAsTimedOut (EventTestCanvas canvas)
		{
			EnqueueCallback (delegate () { Assert.Fail ("Test timed out."); });
			EnqueueTestComplete ();
		}
示例#14
0
文件: EventTest.cs 项目: dfr0/moon
		public void MarkTestAsFailed (EventTestCanvas canvas, string message)
		{
			Enqueue (() => Assert.Fail (message));
			EnqueueTestComplete ();
		}
示例#15
0
文件: EventTest.cs 项目: dfr0/moon
		public void MarkAsDone (EventTestCanvas canvas)
		{
			// The test framework automatically clears TestPanel's children
			EnqueueTestComplete ();
		}
示例#16
0
文件: EventTest.cs 项目: dfr0/moon
		public void TestCaseMismatch ()
		{
			EnqueueCompleteIfEtcIsNull (delegate ()
			{
				Assert.Throws (delegate () { etc = new EventTestCanvas (this, "Event_CaseMismatch.xaml"); }, typeof (XamlParseException));
			});
		}
示例#17
0
文件: EventTest.cs 项目: dfr0/moon
		public void TestOverloadedValid ()
		{
			EnqueueCompleteIfEtcIsNull (delegate ()
			{
				Assert.Throws (delegate () { etc = new EventTestCanvas (this, "Event_OverloadedValid.xaml"); }, typeof (XamlParseException));
			});
		}
示例#18
0
文件: EventTest.cs 项目: dfr0/moon
		public void TestExact_CaseMismatch ()
		{
			EnqueueCompleteIfEtcIsNull (delegate ()
			{
				// Case doesn't matter. VS always embeds resources in lowercase
				Assert.Throws<XamlParseException>(delegate () { etc = new EventTestCanvas (this, "event_exactcasemismatch.xaml"); });					
			});
		}
示例#19
0
 public void MarkTestAsFailed(EventTestCanvas canvas, string message)
 {
     Enqueue(() => Assert.Fail(message));
     EnqueueTestComplete();
 }
示例#20
0
 public void MarkTestAsTimedOut(EventTestCanvas canvas)
 {
     EnqueueCallback(delegate() { Assert.Fail("Test timed out."); });
     EnqueueTestComplete();
 }
示例#21
0
文件: EventTest.cs 项目: dfr0/moon
		public void TestInexistentResource ()
		{
			// Note "moon_unit" instead of "moon-unit"
			// this isn't supposed to neither throw an exception (this xaml file should throw an exception), nor load anything at all
			EnqueueCompleteIfThrows (delegate ()
			{
				etc = new EventTestCanvas (this, new Uri ("/moon_unit;component/misc/Events/Event_InexistentResource.xaml", UriKind.Relative));
				Assert.AreNotEqual (123, etc.Width);
				EnqueueTestComplete ();
			});

		}
示例#22
0
 public void MarkAsDone(EventTestCanvas canvas)
 {
     // The test framework automatically clears TestPanel's children
     EnqueueTestComplete();
 }
示例#23
0
文件: EventTest.cs 项目: dfr0/moon
		public void TestRoutedEventArgs ()
		{
			EnqueueCompleteIfThrows (delegate ()
			{
				etc = new EventTestCanvas (this, "Event_RoutedEventArgs.xaml");
				etc.StartTimeout ();
				Assert.AreEqual (123, etc.Width);
			});
		}
示例#24
0
文件: EventTest.cs 项目: dfr0/moon
		public void TestExDerived3 ()
		{
			EnqueueCompleteIfThrows (delegate ()
			{
				etc = new EventTestCanvas (this, "Event_Ex_Derived3.xaml");
				Assert.AreEqual (123, etc.Width);
			});
		}