protected override void Context() { _compression = A.Fake <IStringCompression>(); _deserializedObject = A.Fake <IObjectBase>(); _underlyingSerializationManager = A.Fake <IStringSerializer>(); _compressedString = "aa"; _uncompressedSting = "bb"; A.CallTo(() => _compression.Decompress(_compressedString)).Returns(_uncompressedSting); A.CallTo(() => _compression.Compress(_uncompressedSting)).Returns(_compressedString); A.CallTo(() => _underlyingSerializationManager.Deserialize <IObjectBase>(_uncompressedSting)).Returns(_deserializedObject); A.CallTo(() => _underlyingSerializationManager.Serialize(_deserializedObject)).Returns(_uncompressedSting); sut = new CompressedStringSerializer(_underlyingSerializationManager, _compression); }
protected override string[] ListFrom(string value) { var decompressedValue = _stringCompression.Decompress(value); return(base.ListFrom(decompressedValue)); }
public TObject Deserialize <TObject>(string serializationString) { return(_underlyingSerializationManager.Deserialize <TObject>(_compression.Decompress(serializationString))); }