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!"); } }
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(); }); }
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(); }); }
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); }
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>(); }
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>(); }
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>(); }
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()); }
public void SetUp() { UITester.Init(typeof(Utils.Net.Sample.App)); UITester.Dispatcher.Invoke(() => { tutorialManager = ((Sample.MainWindowViewModel)UITester.MainWindow.DataContext).TutorialManager; tutorialManager.Start(); }); }
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); }); }
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()); }
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); }
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); }); }
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(); }); }
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(); } }; }
public void SetUp() { UITester.Init(typeof(Utils.Net.Sample.App)); testProgressDialog = UITester.Dispatcher.Invoke(() => ProgressDialog.Show("Test", 100)); }
private void Awake() { UITester.Instance = this; appCanvas = GetComponent <Canvas>(); }