コード例 #1
0
ファイル: UITesterEditor.cs プロジェクト: sarbian/KodeUI
    public override void OnInspectorGUI()
    {
        DrawDefaultInspector();

        UITester controller = (UITester)target;

        if (!controller.testUI && GUILayout.Button("Build UI"))
        {
            controller.BuildUI();
        }

        if (controller.testUI && GUILayout.Button("Destroy UI"))
        {
            controller.DestroyUI();
        }

        Event current = Event.current;

        if (current.type != EventType.KeyDown)
        {
            return;
        }

        if (current.keyCode == KeyCode.RightAlt)
        {
            Debug.Log("ALT!");
        }
    }
コード例 #2
0
        public void SetUp()
        {
            UITester.Init(typeof(Utils.Net.Sample.App));
            UITester.Dispatcher.Invoke(() =>
            {
                var settings = new Settings();

                var commands = new Dictionary <string, ICommand>
                {
                    {
                        "Browse",
                        new RelayCommand <Settings>(s => s.Name = "OK")
                    }
                };

                testSettingsDialog = new SettingsDialog(new object()); // for code coverage
                testSettingsDialog = new SettingsDialog(testSettings); // for code coverage
                testSettingsDialog = new SettingsDialog(testSettings, commands);

                var window = new Window()
                {
                    Content               = testSettingsDialog,
                    ResizeMode            = ResizeMode.NoResize,
                    SizeToContent         = SizeToContent.WidthAndHeight,
                    MaxWidth              = 400,
                    WindowStartupLocation = WindowStartupLocation.CenterOwner,
                    WindowStyle           = WindowStyle.SingleBorderWindow,
                    ShowInTaskbar         = false,
                };
                window.Show();
            });
        }
コード例 #3
0
        public void SetUp()
        {
            UITester.Init(typeof(Utils.Net.Sample.App));
            UITester.Dispatcher.Invoke(() =>
            {
                testTutorialDialog = new TutorialDialog(new Managers.TutorialManager(), "Title", "Text")
                {
                    PreviousButtonText   = "Previous",
                    NextButtonText       = "Next",
                    IsCloseButtonVisible = true,
                    IsCheckboxVisible    = true
                };

                var window = new Window()
                {
                    Content               = testTutorialDialog,
                    ResizeMode            = ResizeMode.NoResize,
                    SizeToContent         = SizeToContent.WidthAndHeight,
                    Width                 = 300,
                    WindowStartupLocation = WindowStartupLocation.CenterOwner,
                    WindowStyle           = WindowStyle.SingleBorderWindow,
                    ShowInTaskbar         = false,
                };
                window.Show();
            });
        }
コード例 #4
0
        public void SetUp()
        {
            UITester.Init(typeof(Utils.Net.Sample.App));

            UITester.Dispatcher.Invoke(() => UITester.Get <System.Windows.Controls.ComboBox>().SelectedItem = "ListPage");
            System.Threading.Thread.Sleep(100);

            testComboBox = UITester.Get <ComboBox>(c => c.IsEditable);
        }
コード例 #5
0
        public void SetUp()
        {
            UITester.Init(typeof(Utils.Net.Sample.App));

            UITester.Dispatcher.Invoke(() => UITester.Get <System.Windows.Controls.ComboBox>().SelectedItem = "ExplorerPage");
            System.Threading.Thread.Sleep(100);

            testVirtualizingWrapPanel = UITester.Get <VirtualizingWrapPanel>();
        }
コード例 #6
0
        public void SetUp()
        {
            UITester.Init(typeof(Utils.Net.Sample.App));

            UITester.Dispatcher.Invoke(() => UITester.Get <ComboBox>().SelectedItem = "ExplorerPage");
            System.Threading.Thread.Sleep(100);

            testTreeView = UITester.Get <TreeView>();
        }
コード例 #7
0
        public void SetUp()
        {
            UITester.Init(typeof(Utils.Net.Sample.App));

            UITester.Dispatcher.Invoke(() => UITester.Get <System.Windows.Controls.ComboBox>().SelectedItem = "OthersPage");
            System.Threading.Thread.Sleep(100);

            testButton = UITester.Get <Button>();
        }
コード例 #8
0
        public void SetUp()
        {
            UITester.Init(typeof(Utils.Net.Sample.App));

            UITester.Dispatcher.Invoke(() => UITester.Get <ComboBox>().SelectedItem = "ExplorerPage");
            System.Threading.Thread.Sleep(100);

            testTreeView = UITester.Get <TreeView>();
            testBehavior = UITester.Dispatcher.Invoke(() => Interaction.GetBehaviors(testTreeView).OfType <TreeViewExtensionBehavior>().Single());
        }
コード例 #9
0
        public void SetUp()
        {
            UITester.Init(typeof(Utils.Net.Sample.App));

            UITester.Dispatcher.Invoke(() =>
            {
                tutorialManager = ((Sample.MainWindowViewModel)UITester.MainWindow.DataContext).TutorialManager;
                tutorialManager.Start();
            });
        }
コード例 #10
0
 public void ItemIdTest()
 {
     // for code coverage
     UITester.Dispatcher.Invoke(() =>
     {
         var tutorialButton = UITester.Get <Button>(b => b.ToolTip.ToString() == "Tutorial");
         TutorialManager.SetItemId(tutorialButton, "test");
         Assert.AreEqual(TutorialManager.GetItemId(tutorialButton), "test");
         TutorialManager.SetItemId(tutorialButton, null);
     });
 }
コード例 #11
0
        public void SetUp()
        {
            UITester.Init(typeof(Utils.Net.Sample.App));

            UITester.Dispatcher.Invoke(() => UITester.Get <ComboBox>().SelectedItem = "ListPage");
            System.Threading.Thread.Sleep(100);

            testListView = UITester.Get <ListView>();
            testGridView = UITester.Dispatcher.Invoke(() => testListView.View as GridView);
            testBehavior = UITester.Dispatcher.Invoke(() => Interaction.GetBehaviors(testListView).OfType <GridViewSortBehavior>().Single());
        }
コード例 #12
0
        public void SetUp()
        {
            UITester.Init(typeof(Utils.Net.Sample.App));

            UITester.Dispatcher.Invoke(() => UITester.Get <System.Windows.Controls.ComboBox>().SelectedItem = "ListPage");
            System.Threading.Thread.Sleep(100);

            var textBox = UITester.Get <TextBox>(t => t.IsVisible);

            testToolTip = UITester.Dispatcher.Invoke(() => textBox.ToolTip as ToolTip);
            UITester.Dispatcher.Invoke(() => testToolTip.IsOpen = true);
        }
コード例 #13
0
        public void SetUp()
        {
            UITester.Init(typeof(Utils.Net.Sample.App));

            UITester.Dispatcher.Invoke(() => UITester.Get <ComboBox>().SelectedItem = "ListPage");
            System.Threading.Thread.Sleep(100);

            testTextBox = UITester.Get <TextBox>();

            UITester.Dispatcher.Invoke(() =>
            {
                testBehavior = new AutoCompleteBehavior
                {
                    ItemsSource      = testAutoCompleteList,
                    StringComparison = System.StringComparison.InvariantCultureIgnoreCase
                };
                testBehavior.Attach(testTextBox);
            });
        }
コード例 #14
0
        public void SetUp()
        {
            UITester.Init(typeof(Utils.Net.Sample.App));
            UITester.Dispatcher.Invoke(() =>
            {
                testSimpleInputDialog = new SimpleInputDialog();

                var window = new Window()
                {
                    Content               = testSimpleInputDialog,
                    ResizeMode            = ResizeMode.NoResize,
                    SizeToContent         = SizeToContent.WidthAndHeight,
                    MaxWidth              = 300,
                    WindowStartupLocation = WindowStartupLocation.CenterOwner,
                    WindowStyle           = WindowStyle.SingleBorderWindow,
                    ShowInTaskbar         = false,
                };
                window.Show();
            });
        }
コード例 #15
0
ファイル: UITesterKeyboard.cs プロジェクト: sarbian/KodeUI
        static UITesterKeyboard()
        {
            SceneView.duringSceneGui += view =>
            {
                var e = Event.current;
                if (e == null || !e.isKey)
                {
                    return;
                }

                if (e.alt && e.keyCode == KeyCode.R)
                {
                    UITester tester = Object.FindObjectOfType <UITester>();
                    Debug.Log("Recreating the UI");
                    if (tester.testUI != null)
                    {
                        tester.DestroyUI();
                    }
                    tester.BuildUI();
                }
            };
        }
コード例 #16
0
 public void SetUp()
 {
     UITester.Init(typeof(Utils.Net.Sample.App));
     testProgressDialog = UITester.Dispatcher.Invoke(() => ProgressDialog.Show("Test", 100));
 }
コード例 #17
0
ファイル: UITester.cs プロジェクト: sarbian/KodeUI
 private void Awake()
 {
     UITester.Instance = this;
     appCanvas         = GetComponent <Canvas>();
 }