Example #1
0
        public void UIKit_CloseAllPanelTest()
        {
            ResKit.Init();

            var uiKitTestPanel  = UIKit.OpenPanel <UIKitTestPanel>();
            var uiKitTestPanel2 = UIKit.OpenPanel <UIKitTestPanel2>();

            UIKit.CloseAllPanel();

            Assert.AreEqual(uiKitTestPanel.State, PanelState.Closed);
            Assert.IsFalse(uiKitTestPanel.gameObject.activeSelf);
            Assert.AreEqual(uiKitTestPanel2.State, PanelState.Closed);
            Assert.IsFalse(uiKitTestPanel2.gameObject.activeSelf);

            UIKit.CloseAllPanel();
        }
Example #2
0
        public void UIKit_PushPopTest()
        {
            ResKit.Init();

            var uiKitTestPanel = UIKit.OpenPanel <UIKitTestPanel>();

            UIKit.Stack.Push <UIKitTestPanel>();

            Assert.AreEqual(uiKitTestPanel.State, PanelState.Closed);

            UIKit.Stack.Pop();

            uiKitTestPanel = UIKit.GetPanel <UIKitTestPanel>();

            Assert.AreEqual(uiKitTestPanel.State, PanelState.Opening);

            UIKit.CloseAllPanel();
        }
Example #3
0
        public void UIKit_OpenPanelDefaultTest()
        {
            ResKit.Init();

            var uiKitTestPanel = UIKit.OpenPanel <UIKitTestPanel>();

            Assert.IsTrue(uiKitTestPanel);

            Assert.AreEqual(uiKitTestPanel.State, PanelState.Opening);
            Assert.AreEqual(uiKitTestPanel.Info.Level, UILevel.Common);
            Assert.AreEqual(uiKitTestPanel.Data.OnInitCalledCount, 1);
            Assert.AreEqual(uiKitTestPanel.Data.OnOpenCalledCount, 1);
            Assert.AreEqual(uiKitTestPanel.Data.OnShowCalledCount, 1);

            UIKit.ClosePanel <UIKitTestPanel>();

            UIKit.CloseAllPanel();
        }
Example #4
0
        public void UIKit_GetPanelTest()
        {
            var uiKitTestPanel = UIKit.GetPanel <UIKitTestPanel>();

            Assert.IsFalse(uiKitTestPanel);

            ResKit.Init();

            UIKit.OpenPanel("UIKitTestPanel");

            uiKitTestPanel = UIKit.GetPanel <UIKitTestPanel>();

            Assert.IsTrue(uiKitTestPanel);
            Assert.AreEqual(uiKitTestPanel.State, PanelState.Opening);

            UIKit.ClosePanel("UIKitTestPanel");

            UIKit.CloseAllPanel();
        }
Example #5
0
        public void UIKit_ShowPanelTest()
        {
            ResKit.Init();

            var uiKitTestPanel = UIKit.OpenPanel <UIKitTestPanel>();

            Assert.AreEqual(uiKitTestPanel.Data.OnShowCalledCount, 1);

            UIKit.ShowPanel <UIKitTestPanel>();

            Assert.AreEqual(uiKitTestPanel.Data.OnShowCalledCount, 2);

            UIKit.HidePanel <UIKitTestPanel>();

            UIKit.ShowPanel <UIKitTestPanel>();

            Assert.AreEqual(uiKitTestPanel.Data.OnShowCalledCount, 3);

            UIKit.CloseAllPanel();
        }
Example #6
0
        public void UIKit_ClosePanelTest()
        {
            ResKit.Init();

            var uiKitTestPanel = UIKit.OpenPanel <UIKitTestPanel>();

            var data = uiKitTestPanel.Data;

            UIKit.ClosePanel <UIKitTestPanel>();

            Assert.AreEqual(data.OnInitCalledCount, 1);
            Assert.AreEqual(data.OnOpenCalledCount, 1);
            Assert.AreEqual(data.OnShowCalledCount, 1);
            Assert.AreEqual(data.OnHideCalledCount, 1);
            Assert.AreEqual(data.OnCloseCalledCount, 1);

            Assert.AreEqual(uiKitTestPanel.State, PanelState.Closed);

            UIKit.CloseAllPanel();
        }