Пример #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.");
        }