Beispiel #1
0
        private void PrintTestContextMenu()
        {
            var m = new GenericMenu();
            var multilineSelection = SelectedLines.Count() > 1;

            if (multilineSelection)
            {
                m.AddItem(s_GUIRunSelected,
                          false,
                          data => RunTests(SelectedLines.Select(line => (object)line.m_Test.TestName).ToArray()),
                          "");
            }
            if (!string.IsNullOrEmpty(m_FullName))
            {
                m.AddItem(s_GUIRun,
                          false,
                          data => RunTests(new[] { (object)m_Test.TestName }),
                          "");
            }
            if (!multilineSelection)
            {
                m.AddSeparator("");

                m.AddItem(s_GUIOpenInEditor,
                          false,
                          data => GuiHelper.OpenInEditor(result, false),
                          "");
            }
            m.ShowAsContext();
        }
        private void PrintTestContextMenu(UnitTestResult test)
        {
            var m = new GenericMenu();

            if ((selectedTests.Count() + selectedGroups.Count()) > 1)
            {
                m.AddItem(guiRunSelected,
                          false,
                          data => RunTest(selectedTests.Select(t => t.Test.FullName)
                                          .Concat(selectedGroups)
                                          .ToArray()),
                          "");
            }
            if (!string.IsNullOrEmpty(test.Test.FullName))
            {
                m.AddItem(guiRun,
                          false,
                          data => RunTest(new[] { test.Test.FullName }),
                          "");
            }
            m.AddSeparator("");

            m.AddItem(guiOpenInEditor,
                      false,
                      data => GuiHelper.OpenInEditor(test, false),
                      "");

            m.ShowAsContext();
        }
Beispiel #3
0
 private void OnLeftMouseButtonClick(Rect rect)
 {
     if (rect.Contains(Event.current.mousePosition) && Event.current.type == EventType.MouseDown && Event.current.button == 0)
     {
         OnSelect();
         if (Event.current.clickCount == 2 && SelectedLines.Count == 1)
         {
             GuiHelper.OpenInEditor(result, true);
         }
     }
 }
        private void OpenFailedTestOnError()
        {
            var test = selectedTests.Single();

            GuiHelper.OpenInEditor(test, true);
        }