public void GetFileNameは引数で指定された名前のシートの内容を格納するファイル名を取得する() { // setup using (FileStream stream = new FileStream(getWorkbookPath(), FileMode.Open, FileAccess.Read)) { XlsxWorkbook workbook = new XlsxWorkbook(stream); // expect Assert.AreEqual("xl/worksheets/sheet1.xml", workbook.GetFileName("test1")); Assert.AreEqual("xl/worksheets/sheet2.xml", workbook.GetFileName("テスト2")); } }
public void SheetNamesはworkbookに格納されるシート名のリストを取得する() { // setup using (FileStream stream = new FileStream(getWorkbookPath(), FileMode.Open, FileAccess.Read)) { XlsxWorkbook workbook = new XlsxWorkbook(stream); // expect Assert.AreEqual(2, workbook.SheetNames.Count); Assert.AreEqual("test1", workbook.SheetNames[0]); Assert.AreEqual("テスト2", workbook.SheetNames[1]); } }
private void ReadWorkbookInformation() { try { this.zipFile = ZipFile.Read(fileName); using (Stream stream = GetInputStream("xl/workbook.xml")) { workbook = new XlsxWorkbook(stream); } using (Stream stream = GetInputStream("xl/styles.xml")) { styles = new XlsxStyles(stream); } using (Stream stream = GetInputStream("xl/sharedStrings.xml")) { sharedStrings = new XlsxSharedStrings(stream); } } finally { Close(); } }