public void CanSetFileNames()
        {
            var reader     = new StandardBinReader();
            var parameters = new ReaderParameters
            {
                Endianness = EndiannessMode.LittleEndian,
                FileNames  = new[] { "test/file1" },
            };

            reader.Initialize(parameters);

            byte[] data =
            {
                0xF9, 0x7D, 0x07, 0x00, 0x01, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
                0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
                0xBA, 0xAD, 0xF0, 0x0D, 0xBA, 0xAD, 0xF0, 0x0D, 0xBA, 0xAD, 0xF0, 0x0D, 0xBA, 0xAD, 0xF0, 0x0D,
            };
            using DataStream stream = DataStreamFactory.FromArray(data, 0, data.Length);
            var format = new BinaryFormat(stream);

            var result = reader.Convert(format);

            Assert.AreEqual(1, result.Root.Children.Count);
            Assert.AreEqual("test", result.Root.Children[0].Name);
            Assert.AreEqual(1, result.Root.Children[0].Children.Count);
            Assert.AreEqual(FileType.Normal, result.Root.Children[0].Children[0].Tags["Type"]);
            Assert.AreEqual("file1", result.Root.Children[0].Children[0].Name);
        }
        public void CanReadDummyFiles()
        {
            var reader     = new StandardBinReader();
            var parameters = new ReaderParameters
            {
                Endianness = EndiannessMode.BigEndian,
                FileNames  = Array.Empty <string>(),
            };

            reader.Initialize(parameters);

            byte[] data =
            {
                0x00, 0x07, 0x7D, 0xF9, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x00,
                0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x70, 0x83, 0x5F, 0x83, 0x7E,
                0x83, 0x5F, 0x83, 0x7E, 0x81, 0x5B, 0x82, 0xC5, 0x82, 0xB7, 0x2E, 0x0D, 0x0A, 0x90, 0xB3, 0x8E,
                0xAE, 0x82, 0xC8, 0x83, 0x66, 0x81, 0x5B, 0x83, 0x5E, 0x82, 0xAA, 0x93, 0xFC, 0x82, 0xE9, 0x82,
                0xDC, 0x82, 0xC5, 0x81, 0x41, 0x82, 0xD0, 0x82, 0xC6, 0x82, 0xDC, 0x82, 0xB8, 0x83, 0x8A, 0x83,
                0x93, 0x83, 0x4E, 0x83, 0x66, 0x81, 0x5B, 0x83, 0x5E, 0x82, 0xF0, 0x8D, 0xEC, 0x90, 0xAC, 0x82,
                0xB7, 0x82, 0xE9, 0x82, 0xBD, 0x82, 0xDF, 0x82, 0xCC, 0x83, 0x5F, 0x83, 0x7E, 0x81, 0x5B, 0x83,
                0x74, 0x83, 0x40, 0x83, 0x43, 0x83, 0x8B, 0x82, 0xC6, 0x82, 0xB5, 0x82, 0xC4, 0x8D, 0xEC, 0x90,
                0xAC, 0x82, 0xB3, 0x82, 0xEA, 0x82, 0xC4, 0x82, 0xA2, 0x82, 0xDC, 0x82, 0xB7, 0x2E, 0x0D, 0x0A,
            };
            using DataStream stream = DataStreamFactory.FromArray(data, 0, data.Length);
            var format = new BinaryFormat(stream);

            var result = reader.Convert(format);

            Assert.AreEqual(1, result.Root.Children.Count);
            Assert.AreEqual(FileType.Dummy, result.Root.Children[0].Tags["Type"]);
        }
        public void CanReadCompressedFilesChangingEndianness()
        {
            var reader     = new StandardBinReader();
            var parameters = new ReaderParameters
            {
                Endianness = EndiannessMode.BigEndian,
                FileNames  = Array.Empty <string>(),
            };

            reader.Initialize(parameters);

            // BIN is Big Endian but has a file in Little Endian
            using DataStream stream = DataStreamFactory.FromFile("MultiEndianTests.bin", FileOpenMode.Read);
            var format = new BinaryFormat(stream);

            var result = reader.Convert(format);

            Assert.AreEqual(2, result.Root.Children.Count);
            Assert.AreEqual(FileType.Normal, result.Root.Children[0].Tags["Type"]);
            Assert.AreEqual(FileType.CompressedAlternateEndian, result.Root.Children[1].Tags["Type"]);
        }