示例#1
0
        public static void LoadComments_ShouldPopulateIssuesCollectionWithNewJiraComments()
        {
            var document = new JiraDocument(getXmlDocument());

            document.Comments.ShouldNotBeEmpty();
            document.Comments.First().CommentId.ShouldBeGreaterThan(0);
            document.Comments.First().Body.ShouldNotBeEmpty();
        }
示例#2
0
        public static void LoadIssues_ShouldPopulateIssuesCollectionWithNewJiraIssues()
        {
            var document = new JiraDocument(getXmlDocument());

            document.Issues.ShouldNotBeEmpty();
            document.Issues.First().IssueId.ShouldBeGreaterThan(0);
            document.Issues.First().Summary.ShouldNotBeEmpty();
        }
示例#3
0
        public static JiraToBitbucketService MockJiraToBitbucketService()
        {
            var loader =
                new FileLoaderService(
                    "C:/Users/marc.costello/Documents/Visual Studio 2012/Projects/JiraToBitBucket/jira_export.xml");

            loader.LoadFile();
            var xmlDocument = new ParserService().Parse(loader.XmlData);
            var document    = new JiraDocument(xmlDocument);

            return(new JiraToBitbucketService(document));
        }
示例#4
0
        private static void BeginProcess(string path)
        {
            var loader = new FileLoaderService(path).LoadFile();

            // TODO: Move parsing into the FileLoaderService - it's a bit overkill as a seperate process.
            var xmlDocument = new ParserService().Parse(loader.XmlData);

            var doc       = new JiraDocument(xmlDocument);
            var converter = new JiraToBitbucketService(doc);

            var bitbucketDoc = converter.BuildBitbucketDocument();

            // Write out the Json result into a file
            string jsonFilePath = loader.JiraXmlFile.Directory.FullName + @"\db-1.0.json";

            using (var jsonFile = new FileStream(jsonFilePath, FileMode.OpenOrCreate,
                                                 FileAccess.ReadWrite))
            {
                using (var writer = new StreamWriter(jsonFile))
                {
                    writer.Write(bitbucketDoc.ToJson());
                }
            }
        }
示例#5
0
 public JiraToBitbucketService(JiraDocument jiraDocument)
 {
     _jiraDocument = jiraDocument;
 }
示例#6
0
        public static void Load_ShouldTthrowIfLoadHasAlreadyBeenCalled()
        {
            var document = new JiraDocument(getXmlDocument());

            Should.Throw <InvalidOperationException>(() => document.Load(getXmlDocument()));
        }