Пример #1
0
            public void Must_parse_correctly(object[] parameters)
            {
                var headerValue = (string)parameters[0];
                var byteRanges  = new List <Tuple <ulong?, ulong?> >();

                for (int i = 1; i < parameters.Length; i += 2)
                {
                    byteRanges.Add(new Tuple <ulong?, ulong?>((ulong?)parameters[i], (ulong?)parameters[i + 1]));
                }

                IEnumerable <RangeHeader> headers = RangeHeader.ParseMany(headerValue);

                Assert.That(headers.Select(arg => new Tuple <ulong?, ulong?>(arg.FirstBytePos, arg.LastBytePos)), Is.EquivalentTo(byteRanges));
            }
Пример #2
0
 public void Must_not_result_in_header(string headerValue)
 {
     Assert.That(RangeHeader.ParseMany(headerValue), Is.Empty);
 }