Exemple #1
0
 public void TestOverloadedValid()
 {
     EnqueueCompleteIfEtcIsNull(delegate()
     {
         Assert.Throws(delegate() { etc = new EventTestCanvas(this, "Event_OverloadedValid.xaml"); }, typeof(XamlParseException));
     });
 }
Exemple #2
0
 public void TestCaseMismatch()
 {
     EnqueueCompleteIfEtcIsNull(delegate()
     {
         Assert.Throws(delegate() { etc = new EventTestCanvas(this, "Event_CaseMismatch.xaml"); }, typeof(XamlParseException));
     });
 }
Exemple #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"); });
     });
 }
Exemple #4
0
 public void TestExDerived3()
 {
     EnqueueCompleteIfThrows(delegate()
     {
         etc = new EventTestCanvas(this, "Event_Ex_Derived3.xaml");
         Assert.AreEqual(123, etc.Width);
     });
 }
Exemple #5
0
 public void TestRoutedEventArgs()
 {
     EnqueueCompleteIfThrows(delegate()
     {
         etc = new EventTestCanvas(this, "Event_RoutedEventArgs.xaml");
         etc.StartTimeout();
         Assert.AreEqual(123, etc.Width);
     });
 }
Exemple #6
0
 public void TestBasic()
 {
     EnqueueCompleteIfThrows(delegate()
     {
         etc = new EventTestCanvas(this, "Event_Basic.xaml");
         etc.StartTimeout();
         //Assert.AreEqual (123, etc.Width);
     });
 }
Exemple #7
0
		public void TestBasic ()
		{
			EnqueueCompleteIfThrows (delegate ()
			{
				etc = new EventTestCanvas (this, "Event_Basic.xaml");
				etc.StartTimeout ();
				//Assert.AreEqual (123, etc.Width);
			});
		}
Exemple #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();
     });
 }
Exemple #9
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;
			}
		}
Exemple #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;
     }
 }
Exemple #11
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]");
				}
			}
		}
Exemple #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]");
         }
     }
 }
Exemple #13
0
		public void MarkTestAsTimedOut (EventTestCanvas canvas)
		{
			EnqueueCallback (delegate () { Assert.Fail ("Test timed out."); });
			EnqueueTestComplete ();
		}
Exemple #14
0
		public void MarkTestAsFailed (EventTestCanvas canvas, string message)
		{
			Enqueue (() => Assert.Fail (message));
			EnqueueTestComplete ();
		}
Exemple #15
0
		public void MarkAsDone (EventTestCanvas canvas)
		{
			// The test framework automatically clears TestPanel's children
			EnqueueTestComplete ();
		}
Exemple #16
0
		public void TestCaseMismatch ()
		{
			EnqueueCompleteIfEtcIsNull (delegate ()
			{
				Assert.Throws (delegate () { etc = new EventTestCanvas (this, "Event_CaseMismatch.xaml"); }, typeof (XamlParseException));
			});
		}
Exemple #17
0
		public void TestOverloadedValid ()
		{
			EnqueueCompleteIfEtcIsNull (delegate ()
			{
				Assert.Throws (delegate () { etc = new EventTestCanvas (this, "Event_OverloadedValid.xaml"); }, typeof (XamlParseException));
			});
		}
Exemple #18
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"); });					
			});
		}
Exemple #19
0
 public void MarkTestAsFailed(EventTestCanvas canvas, string message)
 {
     Enqueue(() => Assert.Fail(message));
     EnqueueTestComplete();
 }
Exemple #20
0
 public void MarkTestAsTimedOut(EventTestCanvas canvas)
 {
     EnqueueCallback(delegate() { Assert.Fail("Test timed out."); });
     EnqueueTestComplete();
 }
Exemple #21
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 ();
			});

		}
Exemple #22
0
 public void MarkAsDone(EventTestCanvas canvas)
 {
     // The test framework automatically clears TestPanel's children
     EnqueueTestComplete();
 }
Exemple #23
0
		public void TestRoutedEventArgs ()
		{
			EnqueueCompleteIfThrows (delegate ()
			{
				etc = new EventTestCanvas (this, "Event_RoutedEventArgs.xaml");
				etc.StartTimeout ();
				Assert.AreEqual (123, etc.Width);
			});
		}
Exemple #24
0
		public void TestExDerived3 ()
		{
			EnqueueCompleteIfThrows (delegate ()
			{
				etc = new EventTestCanvas (this, "Event_Ex_Derived3.xaml");
				Assert.AreEqual (123, etc.Width);
			});
		}