Ejemplo n.º 1
0
        protected override void BeginProcessing()
        {
            this.CheckCmdletParameters();

            TLSrvGetProjectCommand command =
                new TLSrvGetProjectCommand(this);
            command.Execute();
        }
        private System.Collections.Generic.List<TestProject> getProjectCollection(
            System.Collections.Generic.List<TestProject> listOfProjects,
            string[] names,
            string[] ids,
            bool makeFail)
        {
            GetTLProjectCommand cmdlet = new GetTLProjectCommand();
            cmdlet.Name = names;
            cmdlet.Id = ids;

            TLAddinData.CurrentTestLinkConnection =
                FakeTestLinkFactory.GetTestLinkWithProjects(listOfProjects);

            if (makeFail) {
                TLAddinData.CurrentTestLinkConnection = null;
            }

            TLSrvGetProjectCommand command =
                new TLSrvGetProjectCommand(cmdlet);
            command.Execute();

            System.Collections.Generic.List<TestProject> resultList =
                new System.Collections.Generic.List<TestProject>();

            foreach (object tpr in PSTestLib.UnitTestOutput.LastOutput) {

                resultList.Add((TestProject)tpr);

            }

            return resultList;
        }
Ejemplo n.º 3
0
        private System.Collections.Generic.List<TestProject> getProject(
            System.Collections.Generic.List<TestProject> listOfProjects,
            string[] names,
            bool makeFail)
        {
            TLProjectCmdletBase cmdlet = new TLProjectCmdletBase();
            cmdlet.Name = names;

            TLAddinData.CurrentTestLinkConnection =
                FakeTestLinkFactory.GetTestLinkWithProjects(listOfProjects);

            if (makeFail) {
                TLAddinData.CurrentTestLinkConnection = null;
            }
            //cmdlet.WriteTrace(cmdlet, "getProject 00001");
            TLSrvGetProjectCommand command =
                new TLSrvGetProjectCommand(cmdlet);
            command.Execute();
            //cmdlet.WriteTrace(cmdlet, "getProject 00002");
            System.Collections.Generic.List<TestProject> resultList =
                new System.Collections.Generic.List<TestProject>();
            //cmdlet.WriteTrace(cmdlet, "getProject 00003");
            foreach (object tpr in PSTestLib.UnitTestOutput.LastOutput) {
            //cmdlet.WriteTrace(cmdlet, "getProject 00004_1");
                resultList.Add((Meyn.TestLink.TestProject)tpr);
            //cmdlet.WriteTrace(cmdlet, "getProject 00004_2");
            }

            return resultList;
        }
        private System.Collections.Generic.List<TestProject> getProjectCollection(
            System.Collections.Generic.List<TestProject> listOfProjects,
            bool makeFail)
        {
            TLProjectCmdletBase cmdlet = new TLProjectCmdletBase();
            cmdlet.Name = null;

            TLAddinData.CurrentTestLinkConnection =
                FakeTestLinkFactory.GetTestLinkWithProjects(listOfProjects);

            if (makeFail) {
                TLAddinData.CurrentTestLinkConnection = null;
            }
            //cmdlet.WriteTrace(cmdlet, "getProjectCollection: 003");
            TLSrvGetProjectCommand command =
                new TLSrvGetProjectCommand(cmdlet);
            command.Execute();
            //cmdlet.WriteTrace(cmdlet, "getProjectCollection: 004");
            System.Collections.Generic.List<TestProject> resultList =
                new System.Collections.Generic.List<TestProject>();
            //cmdlet.WriteTrace(cmdlet, "getProjectCollection: 005");
            //cmdlet.WriteTrace(cmdlet, "IsInitialized: " + PSTestLib.UnitTestOutput.IsInitialized.ToString());
            foreach (object tpr in PSTestLib.UnitTestOutput.LastOutput) {
            //cmdlet.WriteTrace(cmdlet, "getProjectCollection: 006");
                resultList.Add((TestProject)tpr);
            //cmdlet.WriteTrace(cmdlet, "getProjectCollection: 007");
            }

            return resultList;
        }