Beispiel #1
0
    static void Compiler_WixSourceGenerated(System.Xml.Linq.XDocument document)
    {
        XElement aspxFileComponent = (from e in document.FindAll("File")
                                      where e.Attribute("Source").Value.EndsWith("Default.aspx")
                                      select e)
                                     .First()
                                     .Parent;

        string dirID = aspxFileComponent.Parent.Attribute("Id").Value;

        XNamespace ns = WixExtension.IIs.ToXNamespace();

        aspxFileComponent.Add(new XElement(ns + "WebVirtualDir",
                                  new XAttribute("Id", "MyWebApp"),
                                  new XAttribute("Alias", "MyWebApp"),
                                  new XAttribute("Directory", dirID),
                                  new XAttribute("WebSite", "DefaultWebSite"),
                                  new XElement(ns + "WebApplication",
                                      new XAttribute("Id", "TestWebApplication"),
                                      new XAttribute("Name", "Test"))));

        document.Root.Select("Product")
                     .Add(new XElement(ns + "WebSite",
                              new XAttribute("Id", "DefaultWebSite"),
                              new XAttribute("Description", "Default Web Site"),
                              new XAttribute("Directory", dirID),
                              new XElement(ns + "WebAddress",
                                   new XAttribute("Id", "AllUnassigned"),
                                    new XAttribute("Port", "80"))));
    }
Beispiel #2
0
        public static Mock<ITestLinkExtra> _getTestLinkMockWithTestSuites(
           System.Collections.Generic.List<Meyn.TestLink.TestProject> listOfProjects,
           System.Collections.Generic.List<Meyn.TestLink.TestPlan> listOfTestPlans,
           System.Collections.Generic.List<Meyn.TestLink.TestPlatform> listOfTestPlatforms,
           System.Collections.Generic.List<Meyn.TestLink.TestPlanTotal> listOfTestPlanTotals,
           System.Collections.Generic.List<Meyn.TestLink.Build> listOfBuilds,
           System.Collections.Generic.List<Meyn.TestLink.TestSuite> listOfTestSuites)
        {
            var testLinkMock = _getTestLinkMockWithBuilds(listOfProjects, listOfTestPlans, listOfTestPlatforms, listOfTestPlanTotals, listOfBuilds);

            testLinkMock.Setup(t => t.GetTestSuitesForTestPlan(It.IsAny<int>())).Returns(() => listOfTestSuites);

            //testLinkMock.Setup(t => t.CreateTestSuite

            testLinkMock.Setup(t => t.GetFirstLevelTestSuitesForTestProject(It.IsAny<int>())).Returns(() => listOfTestSuites);

            //testLinkMock.Setup(t => t.GetTestCasesForTestSuite

            testLinkMock.Setup(t => t.GetTestSuiteById(It.IsAny<int>())).Returns((int id) => listOfTestSuites.Find(ts => ts.id == id));

            testLinkMock.Setup(t => t.GetTestSuitesForTestSuite(It.IsAny<int>())).Returns((int id) => listOfTestSuites.FindAll(ts => ts.parentId == id));

            //testLinkMock.Setup(t => t.UploadTestSuiteAttachment

            return testLinkMock;
        }
Beispiel #3
0
        public static Mock<ITestLinkExtra> _getTestLinkMockWithTestPlans(
           System.Collections.Generic.List<Meyn.TestLink.TestProject> listOfProjects,
           System.Collections.Generic.List<Meyn.TestLink.TestPlan> listOfTestPlans,
           System.Collections.Generic.List<Meyn.TestLink.TestPlatform> listOfTestPlatforms,
           System.Collections.Generic.List<Meyn.TestLink.TestPlanTotal> listOfTestPlanTotals)
        {
            var testLinkMock = _getTestLinkMockWithProjects(listOfProjects);

            testLinkMock.Setup(t => t.GetProjectTestPlans(It.IsAny<int>()))
                .Returns((int prjId) => listOfTestPlans.FindAll(tPlan => tPlan.testproject_id == prjId));

            testLinkMock.Setup(t => t.getTestPlanByName(It.IsAny<string>(), It.IsAny<string>()))
                .Returns((string prjName, string planName) => listOfTestPlans
                         .FindAll(plan => plan.name == planName &&
                                  plan.testproject_id == (listOfProjects.Find(prj => prj.name == prjName)).id)[0]);

            if (null != listOfTestPlatforms) {
                //testLinkMock.Setup(t => t.GetTestPlanPlatforms(It.IsAny<int>())).Returns((int tpId) => listOfTestPlatforms.FindAll(platform => platform.id > 0)); // all
                testLinkMock.Setup(t => t.GetTestPlanPlatforms(It.IsAny<int>())).Returns(() => listOfTestPlatforms); // all
            }

            if (null != listOfTestPlanTotals) {
                testLinkMock.Setup(t => t.GetTotalsForTestPlan(It.IsAny<int>())).Returns(() => listOfTestPlanTotals); // all
            }

            return testLinkMock;
        }
Beispiel #4
0
        public static Mock<ITestLinkExtra> _getTestLinkMockWithBuilds(
           System.Collections.Generic.List<Meyn.TestLink.TestProject> listOfProjects,
           System.Collections.Generic.List<Meyn.TestLink.TestPlan> listOfTestPlans,
           System.Collections.Generic.List<Meyn.TestLink.TestPlatform> listOfTestPlatforms,
           System.Collections.Generic.List<Meyn.TestLink.TestPlanTotal> listOfTestPlanTotals,
           System.Collections.Generic.List<Meyn.TestLink.Build> listOfBuilds)
        {
            var testLinkMock = _getTestLinkMockWithTestPlans(listOfProjects, listOfTestPlans, listOfTestPlatforms, listOfTestPlanTotals);

            testLinkMock.Setup(t => t.GetBuildsForTestPlan(It.IsAny<int>()))
                .Returns((int tPlanId) => listOfBuilds.FindAll(build => build.testplan_id == tPlanId));

            testLinkMock.Setup(t => t.GetLatestBuildForTestPlan(It.IsAny<int>()))
                .Returns((int tplanid) => listOfBuilds.Find(build => build.testplan_id == tplanid)); //there's no date for a build

            return testLinkMock;
        }