58 instantiations of RangeConditionHeaderValue
Microsoft.AspNetCore.Http.Extensions.Tests (1)
HeaderDictionaryTypeExtensionsTest.cs (1)
75var expected = new RangeConditionHeaderValue("\"etag1\"");
Microsoft.AspNetCore.Http.Results.Tests (12)
src\Shared\ResultsTests\FileContentResultTestBase.cs (3)
107requestHeaders.IfRange = new RangeConditionHeaderValue(DateTimeOffset.MinValue); 146requestHeaders.IfRange = new RangeConditionHeaderValue(new EntityTagHeaderValue("\"Etag\"")); 180requestHeaders.IfRange = new RangeConditionHeaderValue(new EntityTagHeaderValue("\"NotEtag\""));
src\Shared\ResultsTests\FileStreamResultTestBase.cs (3)
88requestHeaders.IfRange = new RangeConditionHeaderValue(new EntityTagHeaderValue("\"Etag\"")); 129requestHeaders.IfRange = new RangeConditionHeaderValue(DateTimeOffset.MinValue); 166requestHeaders.IfRange = new RangeConditionHeaderValue(DateTimeOffset.MinValue);
src\Shared\ResultsTests\PhysicalFileResultTestBase.cs (3)
77requestHeaders.IfRange = new RangeConditionHeaderValue(new EntityTagHeaderValue("\"Etag\"")); 109requestHeaders.IfRange = new RangeConditionHeaderValue(new EntityTagHeaderValue("\"Etag\"")); 136requestHeaders.IfRange = new RangeConditionHeaderValue(new EntityTagHeaderValue("\"NotEtag\""));
src\Shared\ResultsTests\VirtualFileResultTestBase.cs (3)
95requestHeaders.IfRange = new RangeConditionHeaderValue(new EntityTagHeaderValue("\"Etag\"")); 132requestHeaders.IfRange = new RangeConditionHeaderValue(new EntityTagHeaderValue("\"Etag\"")); 165requestHeaders.IfRange = new RangeConditionHeaderValue(new EntityTagHeaderValue("\"NotEtag\""));
Microsoft.AspNetCore.Mvc.Core.Test (14)
FileResultHelperTest.cs (2)
262httpRequestHeaders.IfRange = ifRange == null ? null : new RangeConditionHeaderValue(ifRange); 367httpRequestHeaders.IfRange = new RangeConditionHeaderValue(ifRangeString);
src\Shared\ResultsTests\FileContentResultTestBase.cs (3)
107requestHeaders.IfRange = new RangeConditionHeaderValue(DateTimeOffset.MinValue); 146requestHeaders.IfRange = new RangeConditionHeaderValue(new EntityTagHeaderValue("\"Etag\"")); 180requestHeaders.IfRange = new RangeConditionHeaderValue(new EntityTagHeaderValue("\"NotEtag\""));
src\Shared\ResultsTests\FileStreamResultTestBase.cs (3)
88requestHeaders.IfRange = new RangeConditionHeaderValue(new EntityTagHeaderValue("\"Etag\"")); 129requestHeaders.IfRange = new RangeConditionHeaderValue(DateTimeOffset.MinValue); 166requestHeaders.IfRange = new RangeConditionHeaderValue(DateTimeOffset.MinValue);
src\Shared\ResultsTests\PhysicalFileResultTestBase.cs (3)
77requestHeaders.IfRange = new RangeConditionHeaderValue(new EntityTagHeaderValue("\"Etag\"")); 109requestHeaders.IfRange = new RangeConditionHeaderValue(new EntityTagHeaderValue("\"Etag\"")); 136requestHeaders.IfRange = new RangeConditionHeaderValue(new EntityTagHeaderValue("\"NotEtag\""));
src\Shared\ResultsTests\VirtualFileResultTestBase.cs (3)
95requestHeaders.IfRange = new RangeConditionHeaderValue(new EntityTagHeaderValue("\"Etag\"")); 132requestHeaders.IfRange = new RangeConditionHeaderValue(new EntityTagHeaderValue("\"Etag\"")); 165requestHeaders.IfRange = new RangeConditionHeaderValue(new EntityTagHeaderValue("\"NotEtag\""));
Microsoft.Net.Http.Headers (1)
RangeConditionHeaderValue.cs (1)
186parsedValue = new RangeConditionHeaderValue();
Microsoft.Net.Http.Headers.Tests (30)
RangeConditionHeaderValueTest.cs (30)
11var rangeCondition = new RangeConditionHeaderValue(new EntityTagHeaderValue("\"x\"")); 16Assert.Throws<ArgumentNullException>(() => new RangeConditionHeaderValue(input)); 22var rangeCondition = new RangeConditionHeaderValue("\"y\""); 26Assert.Throws<ArgumentException>(() => new RangeConditionHeaderValue((string?)null)); 32var rangeCondition = new RangeConditionHeaderValue( 41var rangeCondition = new RangeConditionHeaderValue(new EntityTagHeaderValue("\"x\"")); 44rangeCondition = new RangeConditionHeaderValue(new DateTimeOffset(2010, 7, 15, 12, 33, 57, TimeSpan.Zero)); 51var rangeCondition1 = new RangeConditionHeaderValue("\"x\""); 52var rangeCondition2 = new RangeConditionHeaderValue(new EntityTagHeaderValue("\"x\"")); 53var rangeCondition3 = new RangeConditionHeaderValue( 55var rangeCondition4 = new RangeConditionHeaderValue( 57var rangeCondition5 = new RangeConditionHeaderValue( 59var rangeCondition6 = new RangeConditionHeaderValue( 72var rangeCondition1 = new RangeConditionHeaderValue("\"x\""); 73var rangeCondition2 = new RangeConditionHeaderValue(new EntityTagHeaderValue("\"x\"")); 74var rangeCondition3 = new RangeConditionHeaderValue( 76var rangeCondition4 = new RangeConditionHeaderValue( 78var rangeCondition5 = new RangeConditionHeaderValue( 80var rangeCondition6 = new RangeConditionHeaderValue( 95CheckValidParse(" \"x\" ", new RangeConditionHeaderValue("\"x\"")); 97new RangeConditionHeaderValue(new DateTimeOffset(1994, 11, 6, 8, 49, 37, TimeSpan.Zero))); 99new RangeConditionHeaderValue(new DateTimeOffset(1994, 11, 9, 8, 49, 37, TimeSpan.Zero))); 100CheckValidParse(" W/ \"tag\" ", new RangeConditionHeaderValue(new EntityTagHeaderValue("\"tag\"", true))); 101CheckValidParse(" w/\"tag\"", new RangeConditionHeaderValue(new EntityTagHeaderValue("\"tag\"", true))); 102CheckValidParse("\"tag\"", new RangeConditionHeaderValue(new EntityTagHeaderValue("\"tag\""))); 126CheckValidTryParse(" \"x\" ", new RangeConditionHeaderValue("\"x\"")); 128new RangeConditionHeaderValue(new DateTimeOffset(1994, 11, 6, 8, 49, 37, TimeSpan.Zero))); 129CheckValidTryParse(" W/ \"tag\" ", new RangeConditionHeaderValue(new EntityTagHeaderValue("\"tag\"", true))); 130CheckValidTryParse(" w/\"tag\"", new RangeConditionHeaderValue(new EntityTagHeaderValue("\"tag\"", true))); 131CheckValidTryParse("\"tag\"", new RangeConditionHeaderValue(new EntityTagHeaderValue("\"tag\"")));
59 references to RangeConditionHeaderValue
Microsoft.AspNetCore.HeaderParsing (5)
CommonHeaders.cs (1)
80public static HeaderSetup<RangeConditionHeaderValue> IfRange => new(HeaderNames.IfRange, RangeConditionHeaderValueParser.Instance);
Parsers\RangeConditionHeaderValueParser.cs (4)
10internal sealed class RangeConditionHeaderValueParser : HeaderParser<RangeConditionHeaderValue> 14public override bool TryParse(StringValues values, [NotNullWhen(true)] out RangeConditionHeaderValue? result, [NotNullWhen(false)] out string? error) 16if (values.Count != 1 || !RangeConditionHeaderValue.TryParse(values[0], out var parsedValue))
Microsoft.AspNetCore.HeaderParsing.Tests (3)
ParserTests.cs (3)
332Assert.True(RangeConditionHeaderValueParser.Instance.TryParse(sv, out var result, out var error)); 352Assert.False(RangeConditionHeaderValueParser.Instance.TryParse(sv, out var result, out var error)); 361Assert.False(RangeConditionHeaderValueParser.Instance.TryParse(sv, out var result, out var error));
Microsoft.AspNetCore.Http.Extensions (6)
HeaderDictionaryTypeExtensions.cs (4)
143private static RangeConditionHeaderValue? ParseCacheRangeConditionHeaderValue(string value) => RangeConditionHeaderValue.TryParse(value, out var result) ? result : null; 196else if (typeof(T) == typeof(RangeConditionHeaderValue))
RequestHeaders.cs (2)
274public RangeConditionHeaderValue? IfRange 278return Headers.Get<RangeConditionHeaderValue>(HeaderNames.IfRange);
Microsoft.AspNetCore.Http.Extensions.Tests (3)
HeaderDictionaryTypeExtensionsTest.cs (3)
73var result = context.Request.GetTypedHeaders().Get<RangeConditionHeaderValue>(HeaderNames.IfRange); 75var expected = new RangeConditionHeaderValue("\"etag1\"");
Microsoft.AspNetCore.Http.Results (1)
src\Shared\ResultsHelpers\FileResultHelper.cs (1)
168var ifRange = httpRequestHeaders.IfRange;
Microsoft.AspNetCore.Mvc.Core (1)
src\Shared\ResultsHelpers\FileResultHelper.cs (1)
168var ifRange = httpRequestHeaders.IfRange;
Microsoft.AspNetCore.StaticAssets (1)
StaticAssetsInvoker.cs (1)
366var ifRangeHeader = _requestHeaders.IfRange;
Microsoft.AspNetCore.StaticFiles (1)
StaticFileContext.cs (1)
203var ifRangeHeader = RequestHeaders.IfRange;
Microsoft.Net.Http.Headers (13)
RangeConditionHeaderValue.cs (13)
15private static readonly HttpHeaderParser<RangeConditionHeaderValue> Parser 16= new GenericHeaderParser<RangeConditionHeaderValue>(false, GetRangeConditionLength); 27/// Initializes a new instance of <see cref="RangeConditionHeaderValue"/>. 36/// Initializes a new instance of <see cref="RangeConditionHeaderValue"/>. 47/// Initializes a new instance of <see cref="RangeConditionHeaderValue"/>. 84var other = obj as RangeConditionHeaderValue; 111/// Parses <paramref name="input"/> as a <see cref="RangeConditionHeaderValue"/> value. 115public static RangeConditionHeaderValue Parse(StringSegment input) 122/// Attempts to parse the specified <paramref name="input"/> as a <see cref="RangeConditionHeaderValue"/>. 126/// <returns><see langword="true"/> if input is a valid <see cref="RangeConditionHeaderValue"/>, otherwise <see langword="false"/>.</returns> 127public static bool TryParse(StringSegment input, [NotNullWhen(true)] out RangeConditionHeaderValue? parsedValue) 133private static int GetRangeConditionLength(StringSegment input, int startIndex, out RangeConditionHeaderValue? parsedValue)
Microsoft.Net.Http.Headers.Tests (25)
RangeConditionHeaderValueTest.cs (25)
11var rangeCondition = new RangeConditionHeaderValue(new EntityTagHeaderValue("\"x\"")); 22var rangeCondition = new RangeConditionHeaderValue("\"y\""); 32var rangeCondition = new RangeConditionHeaderValue( 41var rangeCondition = new RangeConditionHeaderValue(new EntityTagHeaderValue("\"x\"")); 51var rangeCondition1 = new RangeConditionHeaderValue("\"x\""); 52var rangeCondition2 = new RangeConditionHeaderValue(new EntityTagHeaderValue("\"x\"")); 53var rangeCondition3 = new RangeConditionHeaderValue( 55var rangeCondition4 = new RangeConditionHeaderValue( 57var rangeCondition5 = new RangeConditionHeaderValue( 59var rangeCondition6 = new RangeConditionHeaderValue( 72var rangeCondition1 = new RangeConditionHeaderValue("\"x\""); 73var rangeCondition2 = new RangeConditionHeaderValue(new EntityTagHeaderValue("\"x\"")); 74var rangeCondition3 = new RangeConditionHeaderValue( 76var rangeCondition4 = new RangeConditionHeaderValue( 78var rangeCondition5 = new RangeConditionHeaderValue( 80var rangeCondition6 = new RangeConditionHeaderValue( 120Assert.Throws<FormatException>(() => RangeConditionHeaderValue.Parse(input)); 149Assert.False(RangeConditionHeaderValue.TryParse(input, out var result)); 155private void CheckValidParse(string input, RangeConditionHeaderValue expectedResult) 157var result = RangeConditionHeaderValue.Parse(input); 161private void CheckValidTryParse(string input, RangeConditionHeaderValue expectedResult) 163Assert.True(RangeConditionHeaderValue.TryParse(input, out var result));