public void GetTLProject_with_params_one_project_by_name()
        {
            string projectName = "project01";

            System.Collections.Generic.List <TestProject> list =
                new System.Collections.Generic.List <TestProject>();
            list.Add(
                FakeTestLinkFactory.GetTestProject(
                    "project00",
                    "prj0",
                    string.Empty));
            list.Add(
                FakeTestLinkFactory.GetTestProject(
                    projectName,
                    "prj1",
                    string.Empty));
            list.Add(
                FakeTestLinkFactory.GetTestProject(
                    "project02",
                    "prj2",
                    string.Empty));

            System.Collections.Generic.List <TestProject> resultList =
                getProject(list, (new string[] { projectName }), false);

            list.RemoveAt(2);
            list.RemoveAt(0);

            Assert.AreEqual <System.Collections.Generic.List <TestProject> >(
                list,
                resultList);
        }
Example #2
0
        public void GetTLProject_Id_ThreeProjects()
        {
            var ids = new [] { "prj1", "prj2", "prj3" };

            var list = new List <TestProject>();

            list.Add(
                FakeTestLinkFactory.GetTestProject(
                    "project1",
                    "prj1",
                    string.Empty));
            list.Add(
                FakeTestLinkFactory.GetTestProject(
                    "project2",
                    "prj2",
                    string.Empty));
            list.Add(
                FakeTestLinkFactory.GetTestProject(
                    "project3",
                    "prj3",
                    string.Empty));

            var resultList = getProjectCollection(list, null, ids, false);

            Assert.AreEqual(
                list,
                UnitTestOutput.LastOutput.AsList <TestProject>());
        }
        public void GetTLProject_broken_connection()
        {
            System.Collections.Generic.List <TestProject> list =
                new System.Collections.Generic.List <TestProject>();
            list.Add(
                FakeTestLinkFactory.GetTestProject(
                    "project1",
                    "prj1",
                    string.Empty));
            list.Add(
                FakeTestLinkFactory.GetTestProject(
                    "project2",
                    "prj2",
                    string.Empty));
            list.Add(
                FakeTestLinkFactory.GetTestProject(
                    "project3",
                    "prj3",
                    string.Empty));
//cmdlet.WriteTrace(cmdlet, "GetTLProject_broken_connection: 001");
            System.Collections.Generic.List <TestProject> resultList =
                getProjectCollection(list, true);
//cmdlet.WriteTrace(cmdlet, "GetTLProject_broken_connection: 002");
            Assert.AreEqual <System.Collections.Generic.List <TestProject> >(
                (new System.Collections.Generic.List <TestProject>()),
                resultList);
        }
Example #4
0
        public void TestProject_from_pipeline_with_broken_connection()
        {
            System.Collections.Generic.List <TestProject> listOfProjects =
                new System.Collections.Generic.List <TestProject>();
            listOfProjects.Add(
                FakeTestLinkFactory.GetTestProject(
                    "project",
                    "prj",
                    string.Empty));

            System.Collections.Generic.List <TestPlan> listOfTestPlans =
                new System.Collections.Generic.List <TestPlan>();
            listOfTestPlans.Add(
                FakeTestLinkFactory.GetTestPlan(
                    "testplan",
                    "notes",
                    true, // active
                    true, // is_public
                    true, // open
                    listOfProjects[0].id));

            System.Collections.Generic.List <TestPlan> resultList =
                getTestPlansFromProjectsInPipeline(listOfProjects, listOfTestPlans, true, false);

            Assert.AreEqual <System.Collections.Generic.List <TestPlan> >(
                (new System.Collections.Generic.List <TestPlan>()),
                resultList);
        }
        public void GetTLProject_three_projects()
        {
            System.Collections.Generic.List <TestProject> list =
                new System.Collections.Generic.List <TestProject>();
            list.Add(
                FakeTestLinkFactory.GetTestProject(
                    "project1",
                    "prj1",
                    string.Empty));
            list.Add(
                FakeTestLinkFactory.GetTestProject(
                    "project2",
                    "prj2",
                    string.Empty));
            list.Add(
                FakeTestLinkFactory.GetTestProject(
                    "project3",
                    "prj3",
                    string.Empty));

            System.Collections.Generic.List <TestProject> resultList =
                getProjectCollection(list, false);

            Assert.AreEqual <System.Collections.Generic.List <TestProject> >(
                list,
                resultList);
        }
Example #6
0
        public void TestProject_not_specified()
        {
            System.Collections.Generic.List <TestProject> listOfProjects =
                new System.Collections.Generic.List <TestProject>();
            listOfProjects.Add(
                FakeTestLinkFactory.GetTestProject(
                    "project01",
                    "prj",
                    string.Empty));
            listOfProjects.Add(
                FakeTestLinkFactory.GetTestProject(
                    "project02",
                    "prj",
                    string.Empty));

            System.Collections.Generic.List <TestPlan> listOfTestPlans =
                new System.Collections.Generic.List <TestPlan>();
            listOfTestPlans.Add(
                FakeTestLinkFactory.GetTestPlan(
                    "testplan 01",
                    "notes",
                    true, // active
                    true, // is_public
                    true, // open
                    listOfProjects[0].id));
            listOfTestPlans.Add(
                FakeTestLinkFactory.GetTestPlan(
                    "testplan 02",
                    "notes",
                    true, // active
                    true, // is_public
                    true, // open
                    listOfProjects[1].id));
            listOfTestPlans.Add(
                FakeTestLinkFactory.GetTestPlan(
                    "testplan 03",
                    "notes",
                    true, // active
                    true, // is_public
                    true, // open
                    listOfProjects[0].id));

            System.Collections.Generic.List <TestPlan> resultList =
                getTestPlansFromProjectsInPipeline(listOfProjects, listOfTestPlans, false, true);

            listOfTestPlans.RemoveAt(1);

            Assert.AreEqual <System.Collections.Generic.List <TestPlan> >(
                //Assert.AreEqual<Meyn.TestLink.TestPlan>(
                listOfTestPlans,
                resultList);
        }
Example #7
0
        public void GetTLProject_NoParameters_OneProject()
        {
            var list = new List <TestProject>();

            list.Add(
                FakeTestLinkFactory.GetTestProject(
                    "project1",
                    "prj1",
                    string.Empty));

            var resultList = getProjectCollection(list, null, null, false);

            Assert.AreEqual(
                list,
                UnitTestOutput.LastOutput.AsList <TestProject>());
        }
        public void GetTLProject_with_params_three_projects_by_id()
        {
            string[] projectNames = { "project01", "project02", "project03" };

            System.Collections.Generic.List <TestProject> list =
                new System.Collections.Generic.List <TestProject>();
            list.Add(
                FakeTestLinkFactory.GetTestProject(
                    projectNames[0],
                    "prj1",
                    string.Empty));
            list.Add(
                FakeTestLinkFactory.GetTestProject(
                    "project04",
                    "prj4",
                    string.Empty));
            list.Add(
                FakeTestLinkFactory.GetTestProject(
                    projectNames[1],
                    "prj2",
                    string.Empty));
            list.Add(
                FakeTestLinkFactory.GetTestProject(
                    projectNames[2],
                    "prj3",
                    string.Empty));

            int[] projectIds =
            { list[0].id, list[2].id, list[3].id };

            System.Collections.Generic.List <TestProject> resultList =
                getProject(list, projectNames, false);

            list.RemoveAt(1);

            Assert.AreEqual <int>(
                projectIds[0],
                resultList[0].id);

            Assert.AreEqual <int>(
                projectIds[1],
                resultList[1].id);

            Assert.AreEqual <int>(
                projectIds[2],
                resultList[2].id);
        }
        public void TestProject_from_pipeline_single_name()
        {
            System.Collections.Generic.List <TestProject> listOfProjects =
                new System.Collections.Generic.List <TestProject>();
            listOfProjects.Add(
                FakeTestLinkFactory.GetTestProject(
                    "project",
                    "prj",
                    string.Empty));

            System.Collections.Generic.List <TestPlan> listOfTestPlans =
                new System.Collections.Generic.List <TestPlan>();
            listOfTestPlans.Add(
                FakeTestLinkFactory.GetTestPlan(
                    "testplan 01",
                    "notes",
                    true, // active
                    true, // is_public
                    true, // open
                    listOfProjects[0].id));
            listOfTestPlans.Add(
                FakeTestLinkFactory.GetTestPlan(
                    "testplan 02",
                    "notes",
                    true, // active
                    true, // is_public
                    true, // open
                    listOfProjects[0].id));
            listOfTestPlans.Add(
                FakeTestLinkFactory.GetTestPlan(
                    "testplan 03",
                    "notes",
                    true, // active
                    true, // is_public
                    true, // open
                    listOfProjects[0].id));

            System.Collections.Generic.List <TestPlan> resultList =
                getTestPlansFromProjectsInPipelineByName(listOfProjects, listOfTestPlans, (new string[] { "testplan 02" }), false, false);

            listOfTestPlans.RemoveAt(2);
            listOfTestPlans.RemoveAt(0);

            Assert.AreElementsSameIgnoringOrder <TestPlan>(
                listOfTestPlans,
                resultList);
        }
        public void GetTLProject_with_params_broken_connection()
        {
            string projectName = "project";

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

            list.Add(
                FakeTestLinkFactory.GetTestProject(
                    projectName,
                    "prj",
                    string.Empty));

            System.Collections.Generic.List <TestProject> resultList =
                getProject(list, (new string[] { projectName }), true);

            Assert.AreEqual <System.Collections.Generic.List <TestProject> >(
                (new System.Collections.Generic.List <TestProject>()),
                resultList);
        }
Example #11
0
        public void TestProject_by_name()
        {
            System.Collections.Generic.List <TestProject> listOfProjects =
                new System.Collections.Generic.List <TestProject>();
            listOfProjects.Add(
                FakeTestLinkFactory.GetTestProject(
                    "project",
                    "prj",
                    string.Empty));

            System.Collections.Generic.List <TestPlan> listOfTestPlans =
                new System.Collections.Generic.List <TestPlan>();
            listOfTestPlans.Add(
                FakeTestLinkFactory.GetTestPlan(
                    "testplan",
                    "notes",
                    true, // active
                    true, // is_public
                    true, // open
                    listOfProjects[0].id));
//cmdlet.WriteTrace(cmdlet, "TestProject_by_name: 0001");
            System.Collections.Generic.List <TestPlan> resultList =
                getTestPlansByProjectName(
                    listOfProjects[0],
                    (new string[1] {
                listOfProjects[0].name
            }),
                    listOfTestPlans,
                    false,
                    false);
//cmdlet.WriteTrace(cmdlet, "TestProject_by_name: 0002");
            Assert.AreEqual <System.Collections.Generic.List <TestPlan> >(
                //Assert.AreEqual<Meyn.TestLink.TestPlan>(
                (new System.Collections.Generic.List <TestPlan>()),
                resultList);
//cmdlet.WriteTrace(cmdlet, "TestProject_by_name: 0003");
        }
Example #12
0
        public void TestProjects_from_pipeline()
        {
            System.Collections.Generic.List <TestProject> listOfProjects =
                new System.Collections.Generic.List <TestProject>();
            listOfProjects.Add(
                FakeTestLinkFactory.GetTestProject(
                    "project1",
                    "prj1",
                    string.Empty));
            listOfProjects.Add(
                FakeTestLinkFactory.GetTestProject(
                    "project2",
                    "prj2",
                    string.Empty));
            listOfProjects.Add(
                FakeTestLinkFactory.GetTestProject(
                    "project3",
                    "prj3",
                    string.Empty));

            System.Collections.Generic.List <TestPlan> listOfTestPlans =
                new System.Collections.Generic.List <TestPlan>();
            listOfTestPlans.Add(
                FakeTestLinkFactory.GetTestPlan(
                    "testplan1",
                    "notes",
                    true, // active
                    true, // is_public
                    true, // open
                    listOfProjects[0].id));
            listOfTestPlans.Add(
                FakeTestLinkFactory.GetTestPlan(
                    "testplan4",
                    "notes",
                    true,  // active
                    true,  // is_public
                    true,  // open
                    111)); //listOfProjects[2].id));
            listOfTestPlans.Add(
                FakeTestLinkFactory.GetTestPlan(
                    "testplan2",
                    "notes",
                    true, // active
                    true, // is_public
                    true, // open
                    listOfProjects[1].id));
            listOfTestPlans.Add(
                FakeTestLinkFactory.GetTestPlan(
                    "testplan3",
                    "notes",
                    true, // active
                    true, // is_public
                    true, // open
                    listOfProjects[2].id));
            listOfTestPlans.Add(
                FakeTestLinkFactory.GetTestPlan(
                    "testplan5",
                    "notes",
                    true, // active
                    true, // is_public
                    true, // open
                    927));

            System.Collections.Generic.List <TestPlan> resultList =
                getTestPlansFromProjectsInPipeline(listOfProjects, listOfTestPlans, false, false);

            listOfTestPlans.RemoveAt(4);
            listOfTestPlans.RemoveAt(1);

            Assert.AreEqual <System.Collections.Generic.List <TestPlan> >(
                //Assert.AreEqual<Meyn.TestLink.TestPlan>(
                listOfTestPlans,
                resultList);
        }