Esempio n. 1
0
        public void HappyFlow()
        {
            var dg     = new DocumentationGenerator();
            var result = dg.GenerateDocumentation();

            Assert.That(result, Is.Not.Null);
        }
Esempio n. 2
0
        public static void Main(string[] args)
        {
            Console.WriteLine("Sharptiles documentation generation");
            if (args.Length != 1 && args.Length != 2)
            {
                throw new ArgumentException("Usage " + ASSEMLBY_NAME +
                                            " <documentation target path> [--json]");
            }
            var json = false;
            var targetPath = args[0];
            if (args.Length == 2 && args[1].Equals("--json"))
            {
                json = true;
            }
            Console.WriteLine($"Generating to {targetPath}");

            var generator = new DocumentationGenerator()
                .For(Scope)
                .AddSpecial(HandleHtmlTags);
//            generator.CopyFiles(targetPath, templatePath);
            try
            {
                if (json)
                {
                    var documentation = generator.BuildModel();
                    var result = JsonConvert.SerializeObject(documentation, Formatting.Indented, new TypeJsonConverter(), new StringEnumConverter());
                    File.WriteAllText(targetPath, result);
                }
                else
                {
                    var documentation = generator.GenerateDocumentation();
                    File.WriteAllText(targetPath, documentation);
                }
            }
            catch (ExceptionWithContext EWC)
            {
                Console.WriteLine(EWC.Message);
                Console.WriteLine(EWC.Context);
            }
            Console.WriteLine("Finished");
        }
 public void HappyFlow()
 {
     var dg = new DocumentationGenerator();
     var result=dg.GenerateDocumentation();
     Assert.That(result, Is.Not.Null);
 }