public void BadFileName() { tableReader = new TableReader(TableReaderType.ReadTypeDump); var result = tableReader.OpenTable(string.Empty); Assert.Equal(false, result); Assert.NotEmpty(tableReader.TableErrors); }
public void ValueTableDumpInsertEntriesMatch() { string tableName = "test.tbl"; using (StreamWriter writer = new StreamWriter(tableName)) { writer.WriteLine("ff=test"); } TableReader insertReader = new TableReader(TableReaderType.ReadTypeInsert); insertReader.OpenTable(tableName); TableReader dumpReader = new TableReader(TableReaderType.ReadTypeDump); dumpReader.OpenTable(tableName); Assert.Equal("test", dumpReader.LookupValue[insertReader.LookupValue["test"]]); Assert.Equal("FF", insertReader.LookupValue[dumpReader.LookupValue["FF"]]); }
/// <summary> /// Gets the decoded strings. /// </summary> /// <param name="tableName">The name of the table.</param> /// <param name="hexBlock">The Hex block to decode</param> /// <param name="endString">Signified the end of a string.</param> /// <returns>The decoded strings in an IEnumerable.</returns> public IEnumerable <string> GetDecodedStrings(string tableName, byte[] hexBlock, string endString) { Table.OpenTable(tableName); SetHexBlock(hexBlock); return(GetDecodedStrings(endString)); }
/// <summary> /// Opens the table. /// </summary> /// <param name="tableFileName">The table file name.</param> /// <param name="encoding">The specified character encoding.</param> /// <returns><c>true</c>, if table was opened successfully, <c>false</c> otherwise.</returns> public bool OpenTable(string tableFileName, Encoding encoding) { return(Table.OpenTable(tableFileName, encoding)); }
public void EntriesHaveCorrectEncoding() { var reader = new TableReader(TableReaderType.ReadTypeDump); reader.OpenTable("../../table.shift-jis", "shift-jis"); Assert.Equal(true, reader.LookupValue.ContainsValue("あ")); }
private bool readTableFile(string entry, TableReader reader) { string tableName = "test.tbl"; using (StreamWriter writer = new StreamWriter(tableName)) { writer.WriteLine(entry); } return reader.OpenTable(tableName); }