71 references to CommonHeaders
Microsoft.AspNetCore.HeaderParsing.Tests (71)
CommonHeadersTests.cs (51)
15
Assert.Equal(HeaderNames.Host,
CommonHeaders
.Host.HeaderName);
16
Assert.Equal(HostHeaderValueParser.Instance,
CommonHeaders
.Host.ParserInstance);
17
Assert.Null(
CommonHeaders
.Host.ParserType);
23
Assert.Equal(HeaderNames.Accept,
CommonHeaders
.Accept.HeaderName);
24
Assert.Equal(MediaTypeHeaderValueListParser.Instance,
CommonHeaders
.Accept.ParserInstance);
25
Assert.Null(
CommonHeaders
.Accept.ParserType);
31
Assert.Equal(HeaderNames.AcceptEncoding,
CommonHeaders
.AcceptEncoding.HeaderName);
32
Assert.Equal(StringWithQualityHeaderValueListParser.Instance,
CommonHeaders
.AcceptEncoding.ParserInstance);
33
Assert.Null(
CommonHeaders
.AcceptEncoding.ParserType);
39
Assert.Equal(HeaderNames.AcceptLanguage,
CommonHeaders
.AcceptLanguage.HeaderName);
40
Assert.Equal(StringWithQualityHeaderValueListParser.Instance,
CommonHeaders
.AcceptLanguage.ParserInstance);
41
Assert.Null(
CommonHeaders
.AcceptLanguage.ParserType);
47
Assert.Equal(HeaderNames.CacheControl,
CommonHeaders
.CacheControl.HeaderName);
48
Assert.Equal(CacheControlHeaderValueParser.Instance,
CommonHeaders
.CacheControl.ParserInstance);
49
Assert.Null(
CommonHeaders
.CacheControl.ParserType);
55
Assert.Equal(HeaderNames.ContentDisposition,
CommonHeaders
.ContentDisposition.HeaderName);
56
Assert.Equal(ContentDispositionHeaderValueParser.Instance,
CommonHeaders
.ContentDisposition.ParserInstance);
57
Assert.Null(
CommonHeaders
.ContentDisposition.ParserType);
63
Assert.Equal(HeaderNames.ContentType,
CommonHeaders
.ContentType.HeaderName);
64
Assert.Equal(MediaTypeHeaderValueParser.Instance,
CommonHeaders
.ContentType.ParserInstance);
65
Assert.Null(
CommonHeaders
.ContentType.ParserType);
71
Assert.Equal(HeaderNames.Cookie,
CommonHeaders
.Cookie.HeaderName);
72
Assert.Equal(CookieHeaderValueListParser.Instance,
CommonHeaders
.Cookie.ParserInstance);
73
Assert.Null(
CommonHeaders
.Cookie.ParserType);
79
Assert.Equal(HeaderNames.Date,
CommonHeaders
.Date.HeaderName);
80
Assert.Equal(DateTimeOffsetParser.Instance,
CommonHeaders
.Date.ParserInstance);
81
Assert.Null(
CommonHeaders
.Date.ParserType);
87
Assert.Equal(HeaderNames.IfMatch,
CommonHeaders
.IfMatch.HeaderName);
88
Assert.Equal(EntityTagHeaderValueListParser.Instance,
CommonHeaders
.IfMatch.ParserInstance);
89
Assert.Null(
CommonHeaders
.IfMatch.ParserType);
95
Assert.Equal(HeaderNames.IfModifiedSince,
CommonHeaders
.IfModifiedSince.HeaderName);
96
Assert.Equal(EntityTagHeaderValueListParser.Instance,
CommonHeaders
.IfModifiedSince.ParserInstance);
97
Assert.Null(
CommonHeaders
.IfModifiedSince.ParserType);
103
Assert.Equal(HeaderNames.IfNoneMatch,
CommonHeaders
.IfNoneMatch.HeaderName);
104
Assert.Equal(EntityTagHeaderValueListParser.Instance,
CommonHeaders
.IfNoneMatch.ParserInstance);
105
Assert.Null(
CommonHeaders
.IfNoneMatch.ParserType);
111
Assert.Equal(HeaderNames.IfRange,
CommonHeaders
.IfRange.HeaderName);
112
Assert.Equal(RangeConditionHeaderValueParser.Instance,
CommonHeaders
.IfRange.ParserInstance);
113
Assert.Null(
CommonHeaders
.IfRange.ParserType);
119
Assert.Equal(HeaderNames.IfUnmodifiedSince,
CommonHeaders
.IfUnmodifiedSince.HeaderName);
120
Assert.Equal(DateTimeOffsetParser.Instance,
CommonHeaders
.IfUnmodifiedSince.ParserInstance);
121
Assert.Null(
CommonHeaders
.IfUnmodifiedSince.ParserType);
127
Assert.Equal(HeaderNames.Range,
CommonHeaders
.Range.HeaderName);
128
Assert.Equal(RangeHeaderValueParser.Instance,
CommonHeaders
.Range.ParserInstance);
129
Assert.Null(
CommonHeaders
.Range.ParserType);
135
Assert.Equal(HeaderNames.Referer,
CommonHeaders
.Referer.HeaderName);
136
Assert.Equal(UriParser.Instance,
CommonHeaders
.Referer.ParserInstance);
137
Assert.Null(
CommonHeaders
.Referer.ParserType);
143
Assert.Equal("X-Forwarded-For",
CommonHeaders
.XForwardedFor.HeaderName);
144
Assert.Equal(IPAddressListParser.Instance,
CommonHeaders
.XForwardedFor.ParserInstance);
145
Assert.Null(
CommonHeaders
.XForwardedFor.ParserType);
HeaderParsingExtensionsTests.cs (3)
81
var headerKey = new HeaderKey<DateTimeOffset>("Test",
CommonHeaders
.Date.ParserInstance!, 0);
83
var headerSetup =
CommonHeaders
.Date;
109
var dateHeaderKey = RegisterHeader(context,
CommonHeaders
.Date);
HeaderParsingFeatureTests.cs (7)
48
var key = Registry.Register(
CommonHeaders
.Date);
66
var key = Registry.Register(
CommonHeaders
.Date);
94
var key = Registry.Register(
CommonHeaders
.Date);
107
var key = Registry.Register(
CommonHeaders
.Date);
124
var key = Registry.Register(
CommonHeaders
.Date);
142
var key = Registry.Register(
CommonHeaders
.Date);
200
var key = Registry.Register(
CommonHeaders
.CacheControl);
HeaderRegistryTests.cs (10)
29
var key = registry.Register(
CommonHeaders
.Date);
32
Assert.Equal(
CommonHeaders
.Date.ParserInstance, key.Parser);
33
Assert.Equal(
CommonHeaders
.Date.HeaderName, key.Name);
46
var key = registry.Register(
CommonHeaders
.Date);
61
Assert.Throws<InvalidOperationException>(() => registry.Register(
CommonHeaders
.Date));
69
var key1 = registry.Register(
CommonHeaders
.Date);
70
var key2 = registry.Register(
CommonHeaders
.Accept);
71
var key3 = registry.Register(
CommonHeaders
.AcceptLanguage);
83
var key1 = registry.Register(
CommonHeaders
.Date);
84
var key2 = registry.Register(
CommonHeaders
.Date);