示例#1
0
        public static void Test_BaseSingleEventListenerInitializable_Works()
        {
            //arrange
            TestEventInterfaceImpl subscriable = new TestEventInterfaceImpl();
            TestSingleEventChild   obj         = new TestSingleEventChild(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()
        {
            //arrange
            TestEventInterfaceImpl subscriable = new TestEventInterfaceImpl();
            TestSingleEventChild   obj         = new TestSingleEventChild(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.");
        }