Ejemplo n.º 1
0
        public static void TestEnsureFileVersion()
        {
            Headers headers = new Headers();

            headers.HeaderBlocks.Add(new PreambleHeaderBlock());
            headers.HeaderBlocks.Add(new VersionHeaderBlock(new byte[] { 4, 1, 2, 0, 0 }));
            headers.HeaderBlocks.Add(new DataHeaderBlock());

            Assert.DoesNotThrow(() => headers.EnsureFileFormatVersion(4, 4));
            Assert.Throws <FileFormatException>(() => headers.EnsureFileFormatVersion(5, 5));
            Assert.Throws <FileFormatException>(() => headers.EnsureFileFormatVersion(1, 3));
        }