Ejemplo n.º 1
0
 public void NullEventRaiseTest()
 {
     Debug.WriteLine("MockEvent: " + MockEvent);
     try
     {
         MockEvent.Raise(this, EventArgs.Empty);
         MockEvent.RaiseEmpty(this);
         MockGenericEvent.Raise(this, new PropertyChangedEventArgs("mockPropoerty"));
     }
     catch (Exception e)
     {
         Assert.Fail("Exception was thrown on null event raise: " + e);
     }
     Assert.IsTrue(MockEvent == null);
     Assert.IsTrue(true);
 }
Ejemplo n.º 2
0
        public void EventRaiseEmptyTest()
        {
            MockEvent += mockEventHandler;

            try
            {
                MockEvent.RaiseEmpty(this);
            }
            catch (MockEventHandlerException exc)
            {
                Assert.AreEqual(exc.args, EventArgs.Empty);
            }
            finally
            {
                MockEvent -= mockEventHandler;
            }
        }