Ejemplo n.º 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();
        }
Ejemplo n.º 2
0
        private void PrintGroupContextMenu()
        {
            var multilineSelection = SelectedLines.Count() > 1;
            var m = new GenericMenu();

            if (multilineSelection)
            {
                m.AddItem(guiRunSelected,
                          false,
                          data => RunTests(SelectedLines.Select(line => line.test.TestName).ToArray()),
                          "");
            }

            if (!string.IsNullOrEmpty(fullName))
            {
                m.AddItem(guiRun,
                          false,
                          data => RunTests(new[] { test.TestName }),
                          "");
            }

            if (!multilineSelection)
            {
                m.AddSeparator("");

                m.AddItem(Folded ? guiExpandAll : guiCollapseAll,
                          false,
                          data => ExpandOrCollapseAll(Folded),
                          "");
            }

            m.ShowAsContext();
        }