コード例 #1
0
ファイル: App.cs プロジェクト: kzu/OctoFlow
        private static void GenerateReport(ProcessRepository process, ProcessType type)
        {
            tracer.Info("Generating report for {0}...", type);

            var flow = process.GetFlow(type);

            var generator = new FlowIssueGenerator(type, flow);

            var body = generator.Render();
            var baseDir = GitRepo.Find(".") ?? ".";
            var output = Path.Combine(baseDir, "~" + type + ".md");
            File.WriteAllText(output, body, Encoding.UTF8);
        }
コード例 #2
0
ファイル: QAFlowTests.cs プロジェクト: kzu/OctoFlow
        public void when_given_issues_then_should_cataloge_process_status()
        {
            var issues = JsonConvert.DeserializeObject<List<Issue>>(File.ReadAllText(@"..\..\json\qa.json"));
            var process = new ProcessRepository(issues);

            var flow = process.GetFlow(ProcessType.QA);

            var generator = new FlowIssueGenerator(ProcessType.QA, flow);

            var body = generator.Render();

            Console.WriteLine(body);

            //var obj = JObject.Parse(body);

            //Console.WriteLine(obj.ToString(Formatting.Indented));
        }
コード例 #3
0
ファイル: ProcessFlowTest.cs プロジェクト: kzu/OctoFlow
        public async Task when_generating_flow_then_succeeds()
        {
            var type = ProcessType.QA;
			var flow = Repository.GetFlow(type);

            var generator = new FlowIssueGenerator(type, flow);

            var body = generator.Render();

            var issue = Repository.AllIssues.Values.FirstOrDefault(i => i.Issue.Title == "~" + type);
            if (issue != null)
            {
                var updated = await github.Issue.Update(
                    Repository.Settings.Repository.Owner,
                    Repository.Settings.Repository.Name,
                    issue.Issue.Number,
                    new IssueUpdate
                    {
                        Body = body
                    });

                Console.WriteLine("Updated issue #" + updated.Number);
            }
            else
            {
                var created = await github.Issue.Create(
                    Repository.Settings.Repository.Owner,
                    Repository.Settings.Repository.Name,
                    new NewIssue("~" + type)
                    {
                        Body = body
                    });

                Console.WriteLine("Created issue #" + created.Number);
            }

            Console.WriteLine(body);
        }