コード例 #1
0
        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));
        }
コード例 #2
0
        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);
        }
コード例 #3
0
        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);
        }
コード例 #4
0
        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);
        }
コード例 #5
0
        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);
            }
        }