public void TestOverloadedValid() { EnqueueCompleteIfEtcIsNull(delegate() { Assert.Throws(delegate() { etc = new EventTestCanvas(this, "Event_OverloadedValid.xaml"); }, typeof(XamlParseException)); }); }
public void TestCaseMismatch() { EnqueueCompleteIfEtcIsNull(delegate() { Assert.Throws(delegate() { etc = new EventTestCanvas(this, "Event_CaseMismatch.xaml"); }, typeof(XamlParseException)); }); }
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"); }); }); }
public void TestExDerived3() { EnqueueCompleteIfThrows(delegate() { etc = new EventTestCanvas(this, "Event_Ex_Derived3.xaml"); Assert.AreEqual(123, etc.Width); }); }
public void TestRoutedEventArgs() { EnqueueCompleteIfThrows(delegate() { etc = new EventTestCanvas(this, "Event_RoutedEventArgs.xaml"); etc.StartTimeout(); Assert.AreEqual(123, etc.Width); }); }
public void TestBasic() { EnqueueCompleteIfThrows(delegate() { etc = new EventTestCanvas(this, "Event_Basic.xaml"); etc.StartTimeout(); //Assert.AreEqual (123, etc.Width); }); }
public void TestBasic () { EnqueueCompleteIfThrows (delegate () { etc = new EventTestCanvas (this, "Event_Basic.xaml"); etc.StartTimeout (); //Assert.AreEqual (123, etc.Width); }); }
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(); }); }
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; } }
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; } }
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]"); } } }
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]"); } } }
public void MarkTestAsTimedOut (EventTestCanvas canvas) { EnqueueCallback (delegate () { Assert.Fail ("Test timed out."); }); EnqueueTestComplete (); }
public void MarkTestAsFailed (EventTestCanvas canvas, string message) { Enqueue (() => Assert.Fail (message)); EnqueueTestComplete (); }
public void MarkAsDone (EventTestCanvas canvas) { // The test framework automatically clears TestPanel's children EnqueueTestComplete (); }
public void TestCaseMismatch () { EnqueueCompleteIfEtcIsNull (delegate () { Assert.Throws (delegate () { etc = new EventTestCanvas (this, "Event_CaseMismatch.xaml"); }, typeof (XamlParseException)); }); }
public void TestOverloadedValid () { EnqueueCompleteIfEtcIsNull (delegate () { Assert.Throws (delegate () { etc = new EventTestCanvas (this, "Event_OverloadedValid.xaml"); }, typeof (XamlParseException)); }); }
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"); }); }); }
public void MarkTestAsFailed(EventTestCanvas canvas, string message) { Enqueue(() => Assert.Fail(message)); EnqueueTestComplete(); }
public void MarkTestAsTimedOut(EventTestCanvas canvas) { EnqueueCallback(delegate() { Assert.Fail("Test timed out."); }); EnqueueTestComplete(); }
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 (); }); }
public void MarkAsDone(EventTestCanvas canvas) { // The test framework automatically clears TestPanel's children EnqueueTestComplete(); }
public void TestRoutedEventArgs () { EnqueueCompleteIfThrows (delegate () { etc = new EventTestCanvas (this, "Event_RoutedEventArgs.xaml"); etc.StartTimeout (); Assert.AreEqual (123, etc.Width); }); }
public void TestExDerived3 () { EnqueueCompleteIfThrows (delegate () { etc = new EventTestCanvas (this, "Event_Ex_Derived3.xaml"); Assert.AreEqual (123, etc.Width); }); }