public void Test_Any_File() { OpenFileDialog ofdBrowseInstance = new OpenFileDialog(); ofdBrowseInstance.DefaultExt = "xml"; ofdBrowseInstance.Filter = "XML Files (*.xml)|*.xml|XBRL Files (*.xbrl)|*.xbrl"; ofdBrowseInstance.RestoreDirectory = true; ofdBrowseInstance.ShowReadOnly = true; ofdBrowseInstance.Title = "Select Instance Document"; if (DialogResult.OK != ofdBrowseInstance.ShowDialog()) { return; } string txtInstancePath = ofdBrowseInstance.FileName; if (!File.Exists(txtInstancePath)) { MessageBox.Show("The path to the instance document could not be found. Please edit the path, or browse to the file and try again."); return; } string txtTaxonomyPath; if (!RB_Tests.IsInstance(txtInstancePath, out txtTaxonomyPath)) { MessageBox.Show("The selected file does not appear to be an instance document. Please check the file and try again."); return; } string error; FilingSummary fs; string folderPath = Path.GetDirectoryName(txtInstancePath); string instancePath = Path.GetFileNameWithoutExtension(txtInstancePath); string taxonomyPath = Path.GetFileNameWithoutExtension(txtTaxonomyPath); TestReportBuilderFinancial trb = new TestReportBuilderFinancial(); bool isBuilt = trb.BuildReports(folderPath, instancePath, taxonomyPath, out fs, out error); Assert.IsTrue(isBuilt, error); }
public void Test_Any_File() { OpenFileDialog ofdBrowseInstance = new OpenFileDialog(); ofdBrowseInstance.DefaultExt = "xml"; ofdBrowseInstance.Filter = "XML Files (*.xml)|*.xml|XBRL Files (*.xbrl)|*.xbrl"; ofdBrowseInstance.RestoreDirectory = true; ofdBrowseInstance.ShowReadOnly = true; ofdBrowseInstance.Title = "Select Instance Document"; if( DialogResult.OK != ofdBrowseInstance.ShowDialog() ) return; string txtInstancePath = ofdBrowseInstance.FileName; if( !File.Exists( txtInstancePath ) ) { MessageBox.Show( "The path to the instance document could not be found. Please edit the path, or browse to the file and try again." ); return; } string txtTaxonomyPath; if( !RB_Tests.IsInstance( txtInstancePath, out txtTaxonomyPath ) ) { MessageBox.Show( "The selected file does not appear to be an instance document. Please check the file and try again." ); return; } string error; FilingSummary fs; string folderPath = Path.GetDirectoryName( txtInstancePath ); string instancePath = Path.GetFileNameWithoutExtension( txtInstancePath ); string taxonomyPath = Path.GetFileNameWithoutExtension( txtTaxonomyPath ); TestReportBuilderFinancial trb = new TestReportBuilderFinancial(); bool isBuilt = trb.BuildReports( folderPath, instancePath, taxonomyPath, out fs, out error ); Assert.IsTrue( isBuilt, error ); }