Example #1
0
        public virtual void EmptyStreamTest()
        {
            var ms = new MemoryStream();

            _formatter.WriteToStream(typeof(SerializerPocoSerializable), default(SerializerPocoSerializable), ms);
            ms.Position = 0;
            var obj = _formatter.ReadFromStream(typeof(SerializerPocoSerializable), ms);

            Assert.Null(obj);

            var emptyBytes = _formatter.SerializeObject(default(SerializerPocoSerializable));

            Assert.Empty(emptyBytes);

            var emptySegment = _formatter.WriteToMemoryPool(default(SerializerPocoSerializable));

            Assert.True(0 == emptySegment.Count);
            Assert.Empty(emptySegment.Array);
        }