public static void ConvertTDCTextToXML(Stream sourceStream, Stream destinationStream) { TDCDat_Text tdcText = new TDCDat_Text(); tdcText.ReadFile(sourceStream); TosecDat_XML tosecXML = new TosecDat_XML() { Contents = tdcText.Contents }; tosecXML.WriteFile(destinationStream); }
public void TosecReader_TestTosecDatWriterXMLClrMamePro() { TosecDat_XML datReader = new TosecDat_XML(); datReader.ReadFile(new MemoryStream(Properties.Resources.IO_FileReaders_ClrMemeProNESFullXML)); if (File.Exists(Path.Combine(AppDomain.CurrentDomain.BaseDirectory, CLRWriterTestDat))) { File.Delete(Path.Combine(AppDomain.CurrentDomain.BaseDirectory, CLRWriterTestDat)); } datReader.WriteFile(Path.Combine(AppDomain.CurrentDomain.BaseDirectory, CLRWriterTestDat)); TosecDat_XML datWrittenReader = new TosecDat_XML(); datWrittenReader.ReadFile(Path.Combine(AppDomain.CurrentDomain.BaseDirectory, CLRWriterTestDat)); Assert.AreEqual(datReader.Contents.game.Length, 12147); Assert.AreEqual(datWrittenReader.Contents.game.Length, 12147); Assert.IsFalse(datWrittenReader.Contents.game.Any(a => a == null) || datWrittenReader.Contents.game.Any(a => a.rom == null)); }