Esempio n. 1
0
        private static void ProcessDoubleClick(TestCaseRequestWrapper request)
        {
            long startTicks = Log.EVENT_HANDLER("Enter", Common.PROJECT_NAME);

            string selectedCell = (string)Globals.ThisAddIn.Application.ActiveCell.Value.ToString();

            Microsoft.Office.Interop.Excel.Range selectedRange = Globals.ThisAddIn.Application.Selection;
            selectedRange.SpecialCells(XlCellType.xlCellTypeVisible).Select();
            Microsoft.Office.Interop.Excel.Range selectedVisibleRange = Globals.ThisAddIn.Application.Selection;

            StringBuilder selectedCellsText = new StringBuilder();

            if (selectedRange.Count > 1)
            {
                foreach (Microsoft.Office.Interop.Excel.Range cell in selectedVisibleRange.Cells)
                {
                    if (selectedCellsText.Length > 0)
                    {
                        selectedCellsText.Append($", {cell.Value}");
                    }
                    else
                    {
                        selectedCellsText.Append($"{cell.Value}");
                    }
                }
            }
            else
            {
                selectedCellsText.Append($"{selectedRange.Value}");
            }

            request.TestID = selectedCellsText.ToString();

            Log.EVENT_HANDLER("Exit", Common.PROJECT_NAME, startTicks);
        }
        private void InitializeViewModel()
        {
            long startTicks = Log.VIEWMODEL("Enter", Common.PROJECT_NAME);

            GetTestPlanInfoCommand  = new DelegateCommand(OnGetTestPlanInfoExecute, OnGetTestPlanInfoCanExecute);
            GetTestSuiteInfoCommand = new DelegateCommand(OnGetTestSuiteInfoExecute, OnGetTestSuiteInfoCanExecute);
            GetTestCaseInfoCommand  = new DelegateCommand(OnGetTestCaseInfoExecute, OnGetTestCaseInfoCanExecute);

            AddPivotSummaryCommand = new DelegateCommand(OnAddPivotSummaryExecute, OnAddPivotSummaryCanExecute);

            TestPlanID_DoubleClickCommand  = new DelegateCommand(OnTestPlanID_DoubleClick, OnTestPlanID_DoubleClickCanExecute);
            TestSuiteID_DoubleClickCommand = new DelegateCommand(OnTestSuiteID_DoubleClick, OnTestSuiteID_DoubleClickCanExecute);
            TestCaseID_DoubleClickCommand  = new DelegateCommand(OnTestCaseID_DoubleClick, OnTestCaseID_DoubleClickCanExecute);

            TestPlanRequest  = new TestPlanRequestWrapper(new TestPlanRequest());
            TestSuiteRequest = new TestSuiteRequestWrapper(new TestSuiteRequest());
            TestCaseRequest  = new TestCaseRequestWrapper(new TestCaseRequest());

            Log.VIEWMODEL("Exit", Common.PROJECT_NAME, startTicks);
        }
Esempio n. 3
0
 private void TestCaseIdDoubleClick(TestCaseRequestWrapper request)
 {
     ProcessDoubleClick(request);
 }