Exemplo n.º 1
0
        private XElement ExtractExamples(IContextActionInfo contextAction, string caPath, string lang)
        {
            // temporarily disabled
            return(null);

            var testFileName = contextAction.MergeKey.Split('.').Last().RemoveFromEnd("Action") + ".cs";
            var goldFileName = testFileName + ".gold";
            var basePath     = Path.Combine(caPath, lang.NormalizeStringForAttribute().ToLower());
            var testFile     = Path.Combine(basePath, testFileName);

            if (!File.Exists(testFile))
            {
                return(null);
            }
            var goldFile = Path.Combine(basePath, goldFileName);

            if (!File.Exists(goldFile))
            {
                return(null);
            }

            var table = XmlHelpers.CreateTwoColumnTable("Before", "After", "50%");

            table.Add(new XElement("tr",
                                   new XElement("td", XmlHelpers.CreateCodeBlock(File.ReadAllText(testFile), lang)),
                                   new XElement("td", XmlHelpers.CreateCodeBlock(File.ReadAllText(goldFile), lang))));

            return(table);
        }
        private XElement ExtractExamples(IContextActionInfo contextAction, string caPath, string lang)
        {
            // temporarily disabled
              return null;
              var testFileName = contextAction.MergeKey.Split('.').Last().RemoveFromEnd("Action") + ".cs";
              var goldFileName = testFileName + ".gold";
              var basePath = Path.Combine(caPath, lang.NormalizeStringForAttribute().ToLower());
              var testFile = Path.Combine(basePath, testFileName);
              if (!File.Exists(testFile)) return null;
              var goldFile = Path.Combine(basePath, goldFileName);
              if (!File.Exists(goldFile)) return null;

              var table = XmlHelpers.CreateTwoColumnTable("Before", "After", "50%");
              table.Add(new XElement("tr",
            new XElement("td", XmlHelpers.CreateCodeBlock(File.ReadAllText(testFile), lang)),
            new XElement("td", XmlHelpers.CreateCodeBlock(File.ReadAllText(goldFile), lang))));

              return table;
        }