public void SubscribeUnsubscribeOnDifferentTargetAsyncTest() { AGSEvent <MockEventArgs> ev = new AGSEvent <MockEventArgs> (); ev.SubscribeToAsync(onEventAsync); EventTests target2 = new EventTests(); ev.UnsubscribeToAsync(target2.onEventAsync); Assert.AreEqual(1, ev.SubscribersCount); }
public void DontClaimEventTest() { AGSEvent <MockEventArgs> ev = new AGSEvent <MockEventArgs>(); ev.Subscribe(onEventDontClaim); EventTests target2 = new EventTests(); ev.Subscribe(target2.onEventDontClaim); ev.Invoke(new MockEventArgs(x)); Assert.AreEqual(2, ev.SubscribersCount); Assert.AreEqual(1, syncEvents); Assert.AreEqual(1, target2.syncEvents); }
public void SubscribeUnsubscribeOnDifferentTargetAsyncTest() { AGSEvent<MockEventArgs> ev = new AGSEvent<MockEventArgs> (); ev.SubscribeToAsync(onEventAsync); EventTests target2 = new EventTests (); ev.UnsubscribeToAsync(target2.onEventAsync); Assert.AreEqual(1, ev.SubscribersCount); }