Exemplo n.º 1
0
        public void Deserialize_HugeCollection_UsesGZip()
        {
            var source = new CollectionObject
            {
                RandomObject1CollectionProperty = FixtureUtils.Array(1000, 1000, () => new RandomObject1
                {
                    StringProperty = FixtureUtils.String()
                }).ToList()
            };

            var serialized   = AzureTableSerializer.Serialize(source);
            var deserialized = AzureTableSerializer.Deserialize <CollectionObject>(Entity(serialized));

            serialized.Keys.Any(k => k.Contains("GZip", StringComparison.Ordinal)).Should().BeTrue();
            deserialized.Should().BeEquivalentTo(source, options => options
                                                 .Excluding(o => o.Timestamp));
        }