Ejemplo n.º 1
0
        public void ReadFrom_InvalidData_Throws()
        {
            var attribute = new CompressionAttribute();

            byte[] data = new byte[attribute.Size];

            Assert.Throws <InvalidDataException>(() => attribute.ReadFrom(data, 0));
        }
Ejemplo n.º 2
0
        public void ReadFrom_Reads()
        {
            byte[] data = Convert.FromBase64String("ZnBtYwMAAACwEQAAAAAAAA==");

            var attribute = new CompressionAttribute();

            Assert.Equal(16, attribute.ReadFrom(data, 0));

            Assert.Equal(CompressionAttribute.DecmpfsMagic, attribute.CompressionMagic);
            Assert.Equal(FileCompressionType.ZlibAttribute, attribute.CompressionType);
            Assert.Equal(16, attribute.Size);
            Assert.Equal(4528u, attribute.UncompressedSize);
        }