public void Lz4UnparsesJObjectToStream()
        {
            var arraySettings = BSONFormatter.GetDefaultSettings();
            arraySettings.TypeNameHandling = BESSy.Json.TypeNameHandling.Objects;

            var bson = new BSONFormatter(arraySettings);
            var zip = new LZ4ZipFormatter(bson);

            var test = TestResourceFactory.CreateRandom() as MockClassC;

            var stream = zip.FormatObjStream(test);
            var len = stream.Length;

            var copy = new MemoryStream();
            stream.CopyTo(copy);

            var unformatted = zip.Parse(stream);

            var formatted = zip.Unparse(unformatted);

            Assert.AreEqual(new StreamReader(copy).ReadToEnd(), new StreamReader(formatted).ReadToEnd());

            Stream os;
            zip.TryUnparse(unformatted, out os);
        }
        public void Lz4ParsesJObjectFromStream()
        {
            var arraySettings = BSONFormatter.GetDefaultSettings();
            arraySettings.TypeNameHandling = BESSy.Json.TypeNameHandling.Objects;

            var bson = new BSONFormatter(arraySettings);
            var zip = new LZ4ZipFormatter(bson);

            var test = TestResourceFactory.CreateRandom() as MockClassC;

            var stream = zip.FormatObjStream(test);

            var unformatted = zip.Parse(stream);

            Assert.AreEqual(unformatted.Value<int>("Id"), test.Id);
            Assert.AreEqual(unformatted.Value<string>("Name"), test.Name);
            Assert.AreEqual((double)unformatted["GetSomeCheckSum"][0], test.GetSomeCheckSum[0]);
            Assert.AreEqual((double)unformatted["Location"]["X"], test.Location.X);
            Assert.AreEqual((double)unformatted["Location"]["Y"], test.Location.Y);
            Assert.AreEqual((double)unformatted["Location"]["Z"], test.Location.Z);
            Assert.AreEqual((double)unformatted["Location"]["W"], test.Location.W);
            Assert.AreEqual((string)unformatted["ReferenceCode"], test.ReferenceCode);
            Assert.AreEqual((Guid)unformatted["ReplicationID"], test.ReplicationID);
        }