예제 #1
0
 void InitComboBox()
 {
     comboSelectTest.Items.Clear();
     foreach (var unitTests in WirelessUnitTesting.FindUnitTests())
     {
         foreach (var test in unitTests.UnitTestMethods)
         {
             ComboBoxItem item = new ComboBoxItem()
             {
                 Content = $"{test.NodeType.Name}: {test.UnitTestMethod.Name}", DataContext = test
             };
             comboSelectTest.Items.Add(item);
         }
     }
     comboSelectTest.SelectedIndex = 0;
 }
예제 #2
0
        void InitUnitTestMenu()
        {
            mnuUnitTest.Items.Clear();
            MenuItem item;

            foreach (var unitTests in WirelessUnitTesting.FindUnitTests())
            {
                item = new MenuItem()
                {
                    Header = $"For {unitTests.NodeType.Name}"
                };


                foreach (var test in unitTests.UnitTestMethods)
                {
                    MenuItem testItem = new MenuItem()
                    {
                        Header = test.UnitTestMethod.Name, DataContext = test
                    };
                    testItem.Click += TestItem_Click;
                    item.Items.Add(testItem);
                }
                mnuUnitTest.Items.Add(item);
            }

            mnuUnitTest.Items.Add(new Separator());
            item = new MenuItem()
            {
                Header = "Run Unit Tests..."
            };
            item.Click += RunTests_Click;
            mnuUnitTest.Items.Add(item);

            mnuUnitTest.Items.Add(new Separator());

            foreach (var report in WirelessReporting.FindReports())
            {
                item = new MenuItem()
                {
                    Header = $"{report.NodeType.Name}:{report.ReportMethod.Name}", DataContext = report
                };
                item.Click += ReportItem_Click;
                mnuUnitTest.Items.Add(item);
            }
        }