private void PositiveAssert(MemoryPoolBlock mem, string raw, string expect) { var begin = BuildSample(mem, raw); var end = GetIterator(begin, raw.Length); var result = UrlPathDecoder.Unescape(begin, end); Assert.Equal(expect, begin.GetUtf8String(result)); }
private void PositiveAssert(string raw) { var begin = BuildSample(raw); var end = GetIterator(begin, raw.Length); var result = UrlPathDecoder.Unescape(begin, end); Assert.NotEqual(raw.Length, begin.GetUtf8String(result).Length); }
private void NegativeAssert(string raw) { var begin = BuildSample(raw); var end = GetIterator(begin, raw.Length); var resultEnd = UrlPathDecoder.Unescape(begin, end); var result = begin.GetString(resultEnd); Assert.Equal(raw, result); }
public void DecodeWithBoundary(string raw, int rawLength, string expect, int expectLength) { var begin = BuildSample(raw); var end = GetIterator(begin, rawLength); var end2 = UrlPathDecoder.Unescape(begin, end); var result = begin.GetUtf8String(end2); Assert.Equal(expectLength, result.Length); Assert.Equal(expect, result); }
public void DecodeWithBoundary(string raw, int rawLength, string expect, int expectLength) { using (var pool = new MemoryPool()) { var mem = pool.Lease(); var begin = BuildSample(mem, raw); var end = GetIterator(begin, rawLength); var end2 = UrlPathDecoder.Unescape(begin, end); var result = begin.GetUtf8String(end2); Assert.Equal(expectLength, result.Length); Assert.Equal(expect, result); pool.Return(mem); } }