Esempio n. 1
0
 private void UpdateStats(TestcaseView testcaseView)
 {
     if (testcaseView.IsExecuted)
         if (testcaseView.Failed)
             m_failed_count += 1;
         else
             m_ok_count += 1;
     else
         m_not_run_count += 1;
 }
Esempio n. 2
0
 private string StatusMessage(TestcaseView testcase)
 {
     if (testcase.IsExecuted == false)
         return testcase.ToString() + " ... not yet run.";
     if (testcase.Failed)
         return "*** " + testcase.ToString() + " --> FAILED:\n\n" + testcase.Exception.Message;
     else
         return testcase.ToString() + " --> OK";
 }
Esempio n. 3
0
 private void Run(TestcaseView testcase)
 {
     if (m_stop_background_runner)
         return;
     //item.Foreground = Brushes.Black; // Colors.Black;
     //m_textbox1.Text = "Running ... " + testcase.ToString();
     //m_textbox2.Text = "";
     testcase.Run();
 }
Esempio n. 4
0
        private TreeViewItem CreateItem(TestcaseView testcase)
        {
            var item = new TreeViewItem();
            item.Header = testcase.TestMethod.Name;
            //item.FontWeight = FontWeights.Bold;
            item.Tag = testcase;
            item.ContextMenu = InitContextMenu(item);
            item.PreviewMouseDown += (o, args) => PresentSummary(item);
            #if false
            ImageSource iconSource=red_icon;
            TextBlock textBlock;
            Image icon;

            StackPanel stack = new StackPanel();
            stack.Orientation = Orientation.Horizontal;
            item.Header = stack;
            //Uncomment this code If you want to add an Image after the             Node-HeaderText
            //textBlock = new TextBlock();
            //textBlock.VerticalAlignment = VerticalAlignment.Center;
            //stack.Children.Add(textBlock);
            icon = new Image();
            icon.VerticalAlignment = VerticalAlignment.Center;
            icon.Margin = new Thickness(0, 0, 4, 0);
            icon.Source = iconSource;
            stack.Children.Add(icon);
            //Add the HeaderText After Adding the icon
            textBlock = new TextBlock();
            textBlock.VerticalAlignment = VerticalAlignment.Center;
            stack.Children.Add(textBlock);
            #endif
            return item;
        }
Esempio n. 5
0
        private void Analyze(Type type, MethodInfo method, ItemCollection collection, TestFixtureView fixture)
        {
            if (method.GetCustomAttributes(typeof(TestAttribute), false).Count() > 0)
            {

                var testcase = new TestcaseView(type, method);
                collection.Add(CreateItem(testcase));
                fixture.AddTest(testcase);
            }
            else if (method.GetCustomAttributes(typeof(SetUpAttribute), false).Count() > 0)
            {
                fixture.SetupMethod = method;
            }
            else if (method.GetCustomAttributes(typeof(TearDownAttribute), false).Count() > 0)
            {
                fixture.TeardownMethod = method;
            }
        }
Esempio n. 6
0
 internal void AddTest(TestcaseView testcase)
 {
     testcase.Fixture = this;
     Tests.Add(testcase);
 }