Example #1
0
        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);
        }
Example #2
0
        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);
        }
Example #3
0
		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);
		}