Beispiel #1
0
        public void PackUnpack()
        {
            var doc      = TestHelpers.CreateStarDocument();
            var original = DocdbGatewayMessage.Create("Star", doc);

            var storage = new InMemoryGatewayBlobStore();

            byte[] packed   = GatewayPacket.Pack(original, storage);
            var    unpacked = GatewayPacket.Unpack <DocdbGatewayMessage>(packed, storage);

            Assert.AreEqual(original.Key, unpacked.Key);

            TestHelpers.AssertEqualStars(
                original.DocumentsAs <StarDocument>().First(),
                unpacked.DocumentsAs <StarDocument>().First()
                );
        }
Beispiel #2
0
        public void PackUnpack()
        {
            var entity   = TestHelpers.CreateStarEntity();
            var original = TableGatewayMessage.Create("Person", entity);

            var storage = new InMemoryGatewayBlobStore();

            byte[] packed = GatewayPacket.Pack(original, storage);
            TableGatewayMessage unpacked = GatewayPacket.Unpack <TableGatewayMessage>(packed, storage);

            Assert.AreEqual(original.Key, unpacked.Key);

            TestHelpers.AssertEqualStars(
                original.EntitiesAs <StarEntity>().First(),
                unpacked.EntitiesAs <StarEntity>().First()
                );
        }