63 instantiations of RangeHeaderValue
Microsoft.AspNetCore.Http.Extensions.Tests (1)
HeaderDictionaryTypeExtensionsTest.cs (1)
87var expected = new RangeHeaderValue(0, 499);
Microsoft.AspNetCore.Http.Results.Tests (19)
src\Shared\ResultsTests\FileContentResultTestBase.cs (4)
63requestHeaders.Range = new RangeHeaderValue(start, end); 106requestHeaders.Range = new RangeHeaderValue(0, 4); 145requestHeaders.Range = new RangeHeaderValue(0, 4); 179requestHeaders.Range = new RangeHeaderValue(0, 4);
src\Shared\ResultsTests\FileStreamResultTestBase.cs (5)
41requestHeaders.Range = new RangeHeaderValue(start, end); 87requestHeaders.Range = new RangeHeaderValue(0, 4); 128requestHeaders.Range = new RangeHeaderValue(0, 4); 165requestHeaders.Range = new RangeHeaderValue(0, 4); 344requestHeaders.Range = new RangeHeaderValue(0, 5);
src\Shared\ResultsTests\PhysicalFileResultTestBase.cs (5)
44requestHeaders.Range = new RangeHeaderValue(start, end); 76requestHeaders.Range = new RangeHeaderValue(0, 3); 108requestHeaders.Range = new RangeHeaderValue(0, 3); 135requestHeaders.Range = new RangeHeaderValue(0, 3); 299requestHeaders.Range = new RangeHeaderValue(start, end);
src\Shared\ResultsTests\VirtualFileResultTestBase.cs (5)
55requestHeaders.Range = new RangeHeaderValue(start, end); 94requestHeaders.Range = new RangeHeaderValue(0, 3); 131requestHeaders.Range = new RangeHeaderValue(0, 3); 164requestHeaders.Range = new RangeHeaderValue(0, 3); 334requestHeaders.Range = new RangeHeaderValue(start, end);
Microsoft.AspNetCore.Mvc.Core.Test (19)
src\Shared\ResultsTests\FileContentResultTestBase.cs (4)
63requestHeaders.Range = new RangeHeaderValue(start, end); 106requestHeaders.Range = new RangeHeaderValue(0, 4); 145requestHeaders.Range = new RangeHeaderValue(0, 4); 179requestHeaders.Range = new RangeHeaderValue(0, 4);
src\Shared\ResultsTests\FileStreamResultTestBase.cs (5)
41requestHeaders.Range = new RangeHeaderValue(start, end); 87requestHeaders.Range = new RangeHeaderValue(0, 4); 128requestHeaders.Range = new RangeHeaderValue(0, 4); 165requestHeaders.Range = new RangeHeaderValue(0, 4); 344requestHeaders.Range = new RangeHeaderValue(0, 5);
src\Shared\ResultsTests\PhysicalFileResultTestBase.cs (5)
44requestHeaders.Range = new RangeHeaderValue(start, end); 76requestHeaders.Range = new RangeHeaderValue(0, 3); 108requestHeaders.Range = new RangeHeaderValue(0, 3); 135requestHeaders.Range = new RangeHeaderValue(0, 3); 299requestHeaders.Range = new RangeHeaderValue(start, end);
src\Shared\ResultsTests\VirtualFileResultTestBase.cs (5)
55requestHeaders.Range = new RangeHeaderValue(start, end); 94requestHeaders.Range = new RangeHeaderValue(0, 3); 131requestHeaders.Range = new RangeHeaderValue(0, 3); 164requestHeaders.Range = new RangeHeaderValue(0, 3); 334requestHeaders.Range = new RangeHeaderValue(start, end);
Microsoft.AspNetCore.StaticFiles.Tests (1)
RangeHelperTests.cs (1)
97var range = new RangeHeaderValue(1, 2);
Microsoft.Net.Http.Headers (1)
RangeHeaderValue.cs (1)
171RangeHeaderValue result = new RangeHeaderValue();
Microsoft.Net.Http.Headers.Tests (22)
RangeHeaderValueTest.cs (22)
11Assert.Throws<ArgumentOutOfRangeException>(() => new RangeHeaderValue(5, 2)); 17var range = new RangeHeaderValue(); 31var range = new RangeHeaderValue(); 44var range1 = new RangeHeaderValue(1, 2); 45var range2 = new RangeHeaderValue(1, 2); 47var range3 = new RangeHeaderValue(1, null); 48var range4 = new RangeHeaderValue(null, 2); 49var range5 = new RangeHeaderValue(); 52var range6 = new RangeHeaderValue(); 66var range1 = new RangeHeaderValue(1, 2); 67var range2 = new RangeHeaderValue(1, 2); 69var range3 = new RangeHeaderValue(1, null); 70var range4 = new RangeHeaderValue(null, 2); 71var range5 = new RangeHeaderValue(); 74var range6 = new RangeHeaderValue(); 77var range7 = new RangeHeaderValue(1, 2); 92CheckValidParse(" bytes=1-2 ", new RangeHeaderValue(1, 2)); 94var expected = new RangeHeaderValue(); 100expected = new RangeHeaderValue(); 105expected = new RangeHeaderValue(); 131CheckValidTryParse(" bytes=1-2 ", new RangeHeaderValue(1, 2)); 133var expected = new RangeHeaderValue();
69 references to RangeHeaderValue
Microsoft.AspNetCore.HeaderParsing (5)
CommonHeaders.cs (1)
90public static HeaderSetup<RangeHeaderValue> Range => new(HeaderNames.Range, RangeHeaderValueParser.Instance);
Parsers\RangeHeaderValueParser.cs (4)
10internal sealed class RangeHeaderValueParser : HeaderParser<RangeHeaderValue> 14public override bool TryParse(StringValues values, [NotNullWhen(true)] out RangeHeaderValue? result, [NotNullWhen(false)] out string? error) 16if (values.Count != 1 || !RangeHeaderValue.TryParse(values[0], out var parsedValue))
Microsoft.AspNetCore.HeaderParsing.Tests (3)
ParserTests.cs (3)
302Assert.True(RangeHeaderValueParser.Instance.TryParse(sv, out var result, out var error)); 314Assert.False(RangeHeaderValueParser.Instance.TryParse(sv, out var result, out var error)); 323Assert.False(RangeHeaderValueParser.Instance.TryParse(sv, out var result, out var error));
Microsoft.AspNetCore.Http.Extensions (6)
HeaderDictionaryTypeExtensions.cs (4)
145private static RangeHeaderValue? ParseCacheRangeHeaderValue(string value) => RangeHeaderValue.TryParse(value, out var result) ? result : null; 200else if (typeof(T) == typeof(RangeHeaderValue))
RequestHeaders.cs (2)
319public RangeHeaderValue? Range 323return Headers.Get<RangeHeaderValue>(HeaderNames.Range);
Microsoft.AspNetCore.Http.Extensions.Tests (3)
HeaderDictionaryTypeExtensionsTest.cs (3)
85var result = context.Request.GetTypedHeaders().Get<RangeHeaderValue>(HeaderNames.Range); 87var expected = new RangeHeaderValue(0, 499);
Microsoft.AspNetCore.Http.Results (1)
src\Shared\RangeHelper\RangeHelper.cs (1)
58var rangeHeader = requestHeaders.Range;
Microsoft.AspNetCore.Mvc.Core (1)
src\Shared\RangeHelper\RangeHelper.cs (1)
58var rangeHeader = requestHeaders.Range;
Microsoft.AspNetCore.StaticAssets (1)
src\Shared\RangeHelper\RangeHelper.cs (1)
58var rangeHeader = requestHeaders.Range;
Microsoft.AspNetCore.StaticFiles (1)
src\Shared\RangeHelper\RangeHelper.cs (1)
58var rangeHeader = requestHeaders.Range;
Microsoft.AspNetCore.StaticFiles.FunctionalTests (1)
src\Shared\RangeHelper\RangeHelper.cs (1)
58var rangeHeader = requestHeaders.Range;
Microsoft.AspNetCore.StaticFiles.Tests (1)
RangeHelperTests.cs (1)
97var range = new RangeHeaderValue(1, 2);
Microsoft.Net.Http.Headers (14)
RangeHeaderValue.cs (14)
14/// The <see cref="RangeHeaderValue"/> class provides support for the Range header as defined in 20private static readonly HttpHeaderParser<RangeHeaderValue> Parser 21= new GenericHeaderParser<RangeHeaderValue>(false, GetRangeLength); 27/// Initializes a new instance of <see cref="RangeHeaderValue"/>. 35/// Initializes a new instance of <see cref="RangeHeaderValue"/>. 105var other = obj as RangeHeaderValue; 130/// Parses <paramref name="input"/> as a <see cref="RangeHeaderValue"/> value. 134public static RangeHeaderValue Parse(StringSegment input) 141/// Attempts to parse the specified <paramref name="input"/> as a <see cref="RangeHeaderValue"/>. 145/// <returns><see langword="true"/> if input is a valid <see cref="RangeHeaderValue"/>, otherwise <see langword="false"/>.</returns> 146public static bool TryParse(StringSegment input, [NotNullWhen(true)] out RangeHeaderValue? parsedValue) 152private static int GetRangeLength(StringSegment input, int startIndex, out RangeHeaderValue? parsedValue) 171RangeHeaderValue result = new RangeHeaderValue();
Microsoft.Net.Http.Headers.Tests (32)
RangeHeaderValueTest.cs (26)
17var range = new RangeHeaderValue(); 31var range = new RangeHeaderValue(); 44var range1 = new RangeHeaderValue(1, 2); 45var range2 = new RangeHeaderValue(1, 2); 47var range3 = new RangeHeaderValue(1, null); 48var range4 = new RangeHeaderValue(null, 2); 49var range5 = new RangeHeaderValue(); 52var range6 = new RangeHeaderValue(); 66var range1 = new RangeHeaderValue(1, 2); 67var range2 = new RangeHeaderValue(1, 2); 69var range3 = new RangeHeaderValue(1, null); 70var range4 = new RangeHeaderValue(null, 2); 71var range5 = new RangeHeaderValue(); 74var range6 = new RangeHeaderValue(); 77var range7 = new RangeHeaderValue(1, 2); 94var expected = new RangeHeaderValue(); 133var expected = new RangeHeaderValue(); 152private void CheckValidParse(string? input, RangeHeaderValue expectedResult) 154var result = RangeHeaderValue.Parse(input); 160Assert.Throws<FormatException>(() => RangeHeaderValue.Parse(input)); 163private void CheckValidTryParse(string? input, RangeHeaderValue expectedResult) 165Assert.True(RangeHeaderValue.TryParse(input, out var result)); 171Assert.False(RangeHeaderValue.TryParse(input, out var result));
RangeItemHeaderValueTest.cs (6)
124RangeHeaderValue? result; 125Assert.False(RangeHeaderValue.TryParse("byte=" + input, out result)); 130RangeHeaderValue? result; 131Assert.True(RangeHeaderValue.TryParse("byte=" + input, out result), input); 144RangeHeaderValue? result; 145Assert.True(RangeHeaderValue.TryParse("byte=" + input, out result), input);