Esempio n. 1
0
        public void SerializeObject_should_Succeed()
        {
            object obj = new Model {
                Prop = "abc"
            };

            var bytes = _serializer.SerializeObject(obj);

            Assert.NotEmpty(bytes);
        }
Esempio n. 2
0
        /// <inheritdoc/>
        public ArraySegment <byte> SerializeObject(object obj)
        {
            var arraySegment = _easyCachingSerializer.SerializeObject(obj);

            var compressedBytes = _compressor.Compress(arraySegment.Array);

            return(new ArraySegment <byte>(compressedBytes));
        }
Esempio n. 3
0
        protected override void Exec(IEasyCachingSerializer serializer)
        {
            var data   = serializer.SerializeObject(_list);
            var result = serializer.DeserializeObject(data);

            if (result == null)
            {
                throw new Exception();
            }
        }
Esempio n. 4
0
 /// <summary>
 /// Serializes the object.
 /// </summary>
 /// <returns>The object.</returns>
 /// <param name="value">Value.</param>
 protected override ArraySegment <byte> SerializeObject(object value)
 {
     return(_serializer.SerializeObject(value));
 }