예제 #1
0
        public void when_using_maptobug_expect_qcbug_mapped_to_bug_appropriately()
        {
            // arrange
            var originalBug = new QCBug {bg_Description = "Desc", bg_Status = "Status", bg_Summary =  "Summary"};
            var expectedBug = new Bug {Description = "Desc", Status = "Status", Summary = "Summary"};

            // act
            var actualBug = new BugRepository().MapToBug().Invoke(originalBug);

            // assert
            Assert.That(actualBug.Description, Is.EqualTo(expectedBug.Description));
            Assert.That(actualBug.Status, Is.EqualTo(expectedBug.Status));
            Assert.That(actualBug.Summary, Is.EqualTo(expectedBug.Summary));
        }
예제 #2
0
        public void Go()
        {
            var rep = new BugRepository();
            foreach (var issue in rep.GetBugs().Select(bug => new Issue()
                                                                {
                                                                    Summary = bug.Summary,
                                                                    Description = PandocHelper.Convert(bug.Description).Replace("<br />", string.Empty),
                                                                    Assignee = "Unassigned",
                                                                    State = MapBugStatus(bug.Status),
                                                                    Type = "Bug",
                                                                    ProjectShortName = "EJ"
                                                                }))
            {
                var conn = new Connection("localhost", 2669);
                conn.Authenticate("root", "10Pounds");

                var issueManagement = new IssueManagement(conn);

                issueManagement.CreateIssue(issue);
            }
        }