Exemple #1
0
        public void TestGeneratingSolutionXmlReport()
        {
            VSSolutionLocMetrics metrics = new VSSolutionLocMetrics("ProjectPilot.sln");

            metrics.LocStatsMap.AddToMap(".cs", new CSharpLocStats());
            metrics.CalculateLocForSolution(@"..\..\..\ProjectPilot.sln");

            const string ReportFileName = @"XML_report.xml";

            metrics.GenerateXmlReport(ReportFileName);

            XmlDocument xmlDocument = new XmlDocument();

            xmlDocument.Load(ReportFileName);

            XmlNode xmlNode = xmlDocument.SelectSingleNode(
                "Root/Item/Subitem/Item[contains(@FileName,'ProjectPilot.Framework.csproj')]");

            Assert.IsNotNull(xmlNode);

            Assert.AreEqual(".csproj", xmlNode.Attributes["FileType"].Value);

            xmlNode = xmlDocument.SelectSingleNode(
                "Root/Item/Subitem/Item/Subitem/Item");

            Assert.AreEqual(".cs", xmlNode.Attributes["FileType"].Value);
        }
Exemple #2
0
        public ActionResult GenerateXML(string solutionFilePath)
        {
            VSSolutionLocMetrics metrics =
                new VSSolutionLocMetrics(solutionFilePath.Substring(solutionFilePath.LastIndexOf(@"\") + 1));

            metrics.LocStatsMap.AddToMap(".cs", new CSharpLocStats());
            metrics.CalculateLocForSolution(solutionFilePath);
            metrics.GenerateXmlReport(@"XML_report.xml");

            return(RedirectToAction("XML", "XML"));
        }
Exemple #3
0
        public void SolutionLocMetrics()
        {
            VSSolutionLocMetrics metrics = new VSSolutionLocMetrics("ProjectPilot.sln");

            // add known extensions
            metrics.LocStatsMap.AddToMap(".cs", new CSharpLocStats());
            metrics.LocStatsMap.AddToMap(".aspx", new AspxLocStats());

            metrics.CalculateLocForSolution(
                @"..\..\..\ProjectPilot.sln");

            LocStatsData data = metrics.GetLocStatsData();
        }