예제 #1
0
        public static void Test_BaseSingleEventListenerInitializable_Works_With_EventHandlerNonGeneric()
        {
            //arrange
            TestEventInterfaceImplNonGeneric subscriable = new TestEventInterfaceImplNonGeneric();
            TestSingleEventChildNonGeneric   obj         = new TestSingleEventChildNonGeneric(subscriable);

            obj.OnGameInitialized().Wait();

            subscriable.CallEvent();

            //We failt if success isn't thrown first
            Assert.Fail();
        }
예제 #2
0
        public static void Test_BaseSingleEventListenerInitializable_WhenUnsubscriberd_Doesnt_Call_Event_NonGeneric()
        {
            //arrange
            TestEventInterfaceImplNonGeneric subscriable = new TestEventInterfaceImplNonGeneric();
            TestSingleEventChildNonGeneric   obj         = new TestSingleEventChildNonGeneric(subscriable, false);

            //sub and then unsub.
            obj.OnGameInitialized().Wait();
            obj.UnSub();

            subscriable.CallEvent();

            //We failt if success isn't thrown first
            Assert.Pass($"Succeded, did not call event.");
        }