public void Compression() { BrotliCompressionService brotliCompressionService = new BrotliCompressionService(); var bogus = new Bogus.Randomizer(); var bytesOrg = Encoding.UTF8.GetBytes(new Lorem().Sentence(500)); var span = new Span <byte>(new byte[bytesOrg.Length + 50]); var result = brotliCompressionService.Compress(bytesOrg, span); result.Length.ShouldBeLessThan(bytesOrg.Length); }
public void GlobalSetup() { _brotliCompressionService = new BrotliCompressionService(); _lz4CompressionService = new Lz4CompressionService(); _nopCompressionService = new NopCompressionService(); var bogus = new Bogus.Randomizer(); _bytesOrg = Encoding.UTF8.GetBytes(new Lorem().Sentence(500)); var buffer = ArrayPool <byte> .Shared.Rent(Constants.MAX_USABLE_BYTES_IN_PAGE + 500); ArrayPool <byte> .Shared.Return(buffer); }