Example #1
0
        /// <summary>
        /// Copies the automatic clipboard.
        /// </summary>
        /// <param name="isCopy">if set to <c>true</c> [copy].</param>
        /// <param name="testSteps">The test steps.</param>
        public static void CopyToClipboardTestSteps(bool isCopy, List <TestStep> testSteps)
        {
            ClipBoardCommand  clipBoardCommand  = isCopy ? ClipBoardCommand.Copy : ClipBoardCommand.Cut;
            ClipBoardTestStep clipBoardTestStep = new ClipBoardTestStep(testSteps, clipBoardCommand);

            ClipBoardManager <ClipBoardTestStep> .CopyToClipboard(clipBoardTestStep);
        }
        /// <summary>
        /// Copies the automatic clipboard.
        /// </summary>
        /// <param name="isCopy">if set to <c>true</c> [copy].</param>
        /// <param name="testCases">The test cases.</param>
        public static void CopyToClipboardTestCases(bool isCopy, List <TestCase> testCases)
        {
            ClipBoardCommand  clipBoardCommand  = isCopy ? ClipBoardCommand.Copy : ClipBoardCommand.Cut;
            ClipBoardTestCase clipBoardTestCase = new ClipBoardTestCase(testCases, clipBoardCommand);

            ClipBoardManager <ClipBoardTestCase> .CopyToClipboard(clipBoardTestCase);

            SerializationManager.IsSerializable(clipBoardTestCase);
        }
 /// <summary>
 /// Initializes a new instance of the <see cref="ClipBoardTestCase"/> class.
 /// </summary>
 /// <param name="testCases">The test cases.</param>
 /// <param name="clipBoardCommand">The clip board command.</param>
 public ClipBoardTestCase(List <TestCase> testCases, ClipBoardCommand clipBoardCommand)
 {
     this.TestCases        = testCases;
     this.ClipBoardCommand = clipBoardCommand;
 }
        /// <summary>
        /// Pastes the suite to parent.
        /// </summary>
        /// <param name="testManagementTeamProject">The test management team project.</param>
        /// <param name="testPlan">The test plan.</param>
        /// <param name="parentSuiteId">The parent suite unique identifier.</param>
        /// <param name="suiteToAddId">The suite automatic add unique identifier.</param>
        /// <param name="clipBoardCommand">The clip board command.</param>
        /// <exception cref="System.ArgumentException">The requirments based suites cannot have child suites!</exception>
        public static void PasteSuiteToParent(ITestManagementTeamProject testManagementTeamProject, ITestPlan testPlan, int parentSuiteId, int suiteToAddId, ClipBoardCommand clipBoardCommand)
        {
            ITestSuiteBase parentSuite = null;
            ITestSuiteBase suiteToAdd = null;
            try
            {
                parentSuite = testManagementTeamProject.TestSuites.Find(parentSuiteId);
            }
            catch (TestManagementValidationException ex)
            {
                log.Error(ex);
            }
            try
            {
                suiteToAdd = testManagementTeamProject.TestSuites.Find(suiteToAddId);
            }
            catch (TestManagementValidationException ex)
            {
                log.Error(ex);
            }
          
            IStaticTestSuite oldParent = suiteToAdd.Parent;
            if (parentSuite != null && parentSuite is IRequirementTestSuite)
            {
                throw new ArgumentException("The requirments based suites cannot have child suites!");
            }

            if (parentSuite != null && parentSuite is IStaticTestSuite && parentSuiteId != -1)
            {
                IStaticTestSuite parentSuiteStatic = parentSuite as IStaticTestSuite;
                parentSuiteStatic.Entries.Add(suiteToAdd);
                log.InfoFormat("Add child suite to suite with Title= {0}, Id = {1}, child suite title= {2}, id= {3}", parentSuite.Title, parentSuite.Id, suiteToAdd.Title, suiteToAdd.Id);
            }
            else
            {
                testPlan.RootSuite.Entries.Add(suiteToAdd);
            }
            if (clipBoardCommand.Equals(ClipBoardCommand.Cut))
            {
                DeleteSuite(testManagementTeamProject, testPlan, suiteToAddId, oldParent);
            }

            testPlan.Save();
        }
 /// <summary>
 /// Initializes a new instance of the <see cref="ClipBoardTestStep"/> class.
 /// </summary>
 /// <param name="testCases">The test steps.</param>
 /// <param name="clipBoardCommand">The clip board command.</param>
 public ClipBoardTestStep(List <TestStep> testSteps, ClipBoardCommand clipBoardCommand)
 {
     this.TestSteps        = testSteps;
     this.ClipBoardCommand = clipBoardCommand;
 }
Example #6
0
        /// <summary>
        /// Pastes the suite to parent.
        /// </summary>
        /// <param name="testManagementTeamProject">The test management team project.</param>
        /// <param name="testPlan">The test plan.</param>
        /// <param name="parentSuiteId">The parent suite unique identifier.</param>
        /// <param name="suiteToAddId">The suite automatic add unique identifier.</param>
        /// <param name="clipBoardCommand">The clip board command.</param>
        /// <exception cref="System.ArgumentException">The requirments based suites cannot have child suites!</exception>
        public static void PasteSuiteToParent(ITestManagementTeamProject testManagementTeamProject, ITestPlan testPlan, int parentSuiteId, int suiteToAddId, ClipBoardCommand clipBoardCommand)
        {
            ITestSuiteBase parentSuite = null;
            ITestSuiteBase suiteToAdd  = null;

            try
            {
                parentSuite = testManagementTeamProject.TestSuites.Find(parentSuiteId);
            }
            catch (TestManagementValidationException ex)
            {
                log.Error(ex);
            }
            try
            {
                suiteToAdd = testManagementTeamProject.TestSuites.Find(suiteToAddId);
            }
            catch (TestManagementValidationException ex)
            {
                log.Error(ex);
            }

            IStaticTestSuite oldParent = suiteToAdd.Parent;

            if (parentSuite != null && parentSuite is IRequirementTestSuite)
            {
                throw new ArgumentException("The requirments based suites cannot have child suites!");
            }

            if (parentSuite != null && parentSuite is IStaticTestSuite && parentSuiteId != -1)
            {
                IStaticTestSuite parentSuiteStatic = parentSuite as IStaticTestSuite;
                parentSuiteStatic.Entries.Add(suiteToAdd);
                log.InfoFormat("Add child suite to suite with Title= {0}, Id = {1}, child suite title= {2}, id= {3}", parentSuite.Title, parentSuite.Id, suiteToAdd.Title, suiteToAdd.Id);
            }
            else
            {
                testPlan.RootSuite.Entries.Add(suiteToAdd);
            }
            if (clipBoardCommand.Equals(ClipBoardCommand.Cut))
            {
                DeleteSuite(testManagementTeamProject, testPlan, suiteToAddId, oldParent);
            }

            testPlan.Save();
        }
 /// <summary>
 /// Initializes a new instance of the <see cref="ClipBoardTestStep"/> class.
 /// </summary>
 /// <param name="testCases">The test steps.</param>
 /// <param name="clipBoardCommand">The clip board command.</param>
 public ClipBoardTestStep(List<TestStep> testSteps, ClipBoardCommand clipBoardCommand)
 {
     this.TestSteps = testSteps;
     this.ClipBoardCommand = clipBoardCommand;
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="ClipBoardTestCase"/> class.
 /// </summary>
 /// <param name="testCases">The test cases.</param>
 /// <param name="clipBoardCommand">The clip board command.</param>
 public ClipBoardTestCase(List<TestCase> testCases, ClipBoardCommand clipBoardCommand)
 {
     this.TestCases = testCases;
     this.ClipBoardCommand = clipBoardCommand;
 }
 public ClipBoardTestCase(List <TestCase> testCases, ClipBoardCommand clipBoardCommand)
 {
     TestCases        = testCases;
     ClipBoardCommand = clipBoardCommand;
 }