public void TosecReader_TestTosecDatReaderClrMamePro()
        {
            TosecDat_Text datReader = new TosecDat_Text();

            datReader.ReadFile(new MemoryStream(Properties.Resources.IO_FileReaders_ClrMemeProNESFull));
            Assert.AreEqual(datReader.Contents.game.Length, 12147);
            Assert.IsFalse(datReader.Contents.game.Any(a => a == null) || datReader.Contents.game.Any(a => a.rom == null));
        }
Exemple #2
0
        public static void ConvertTosecTextToXML(Stream sourceStream, Stream destinationStream)
        {
            TosecDat_Text tosecText = new TosecDat_Text();

            tosecText.ReadFile(sourceStream);
            TosecDat_XML tosecXML = new TosecDat_XML()
            {
                Contents = tosecText.Contents
            };

            tosecXML.WriteFile(destinationStream);
        }
        public void TosecReader_TestTosecDatWriterClrMamePro()
        {
            TosecDat_Text datReader = new TosecDat_Text();

            datReader.ReadFile(new MemoryStream(Properties.Resources.IO_FileReaders_ClrMemeProNESFull));

            if (File.Exists(Path.Combine(AppDomain.CurrentDomain.BaseDirectory, CLRWriterTextTestDat)))
            {
                File.Delete(Path.Combine(AppDomain.CurrentDomain.BaseDirectory, CLRWriterTextTestDat));
            }
            datReader.WriteFile(Path.Combine(AppDomain.CurrentDomain.BaseDirectory, CLRWriterTextTestDat));

            TosecDat_Text datWrittenReader = new TosecDat_Text();

            datWrittenReader.ReadFile(Path.Combine(AppDomain.CurrentDomain.BaseDirectory, CLRWriterTextTestDat));

            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));
        }