public void GenerateQR(string qrData) { stringCompressor = new StringCompression(); if (String.Compare(qrData, "") != 0) { rawImage.texture = GenerateTexture(stringCompressor.Compress(qrData)); } }
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 StringValueFor(List <string> list) { var value = base.StringValueFor(list); return(_stringCompression.Compress(value)); }
public string Serialize <TObject>(TObject objectToSerialize) { return(_compression.Compress(_underlyingSerializationManager.Serialize(objectToSerialize))); }