public static void LoadComments_ShouldPopulateIssuesCollectionWithNewJiraComments() { var document = new JiraDocument(getXmlDocument()); document.Comments.ShouldNotBeEmpty(); document.Comments.First().CommentId.ShouldBeGreaterThan(0); document.Comments.First().Body.ShouldNotBeEmpty(); }
public static void LoadIssues_ShouldPopulateIssuesCollectionWithNewJiraIssues() { var document = new JiraDocument(getXmlDocument()); document.Issues.ShouldNotBeEmpty(); document.Issues.First().IssueId.ShouldBeGreaterThan(0); document.Issues.First().Summary.ShouldNotBeEmpty(); }
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)); }
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()); } } }
public JiraToBitbucketService(JiraDocument jiraDocument) { _jiraDocument = jiraDocument; }
public static void Load_ShouldTthrowIfLoadHasAlreadyBeenCalled() { var document = new JiraDocument(getXmlDocument()); Should.Throw <InvalidOperationException>(() => document.Load(getXmlDocument())); }