54 writes to Value
Microsoft.Net.Http.Headers (7)
ContentDispositionHeaderValue.cs (3)
186
sizeParameter.
Value
= value.GetValueOrDefault().ToString(CultureInfo.InvariantCulture);
390
dateParameter.
Value
= dateString;
455
nameParameter.
Value
= processedValue;
HeaderUtilities.cs (1)
39
qualityParameter.
Value
= qualityString;
MediaTypeHeaderValue.cs (2)
96
charsetParameter.
Value
= value;
170
boundaryParameter.
Value
= value;
NameValueHeaderValue.cs (1)
199
Value
= HeaderUtilities.EscapeAsQuotedString(value);
Microsoft.Net.Http.Headers.Tests (47)
NameValueHeaderValueTest.cs (47)
68
pair0.
Value
= "othervalue";
86
pair0.
Value
= "othervalue";
89
Assert.Throws<InvalidOperationException>(() => { pair1.
Value
= "othervalue"; });
102
pair0.
Value
= "othervalue";
119
pair0.
Value
= "othervalue";
122
Assert.Throws<InvalidOperationException>(() => { pair1.
Value
= "othervalue"; });
136
pair2.
Value
= "othervalue";
145
Assert.Throws<FormatException>(() => { var x = new NameValueHeaderValue("name"); x.
Value
= " x "; });
146
Assert.Throws<FormatException>(() => { var x = new NameValueHeaderValue("name"); x.
Value
= "x y"; });
155
nameValue.
Value
= "\"quoted string\"";
158
nameValue.
Value
= null;
161
nameValue.
Value
= string.Empty;
171
nameValue1.
Value
= null;
172
nameValue2.
Value
= null;
175
nameValue1.
Value
= "token";
176
nameValue2.
Value
= null;
179
nameValue1.
Value
= "token";
180
nameValue2.
Value
= string.Empty;
183
nameValue1.
Value
= null;
184
nameValue2.
Value
= string.Empty;
187
nameValue1.
Value
= "token";
188
nameValue2.
Value
= "TOKEN";
191
nameValue1.
Value
= "token";
192
nameValue2.
Value
= "token";
195
nameValue1.
Value
= "\"quoted string\"";
196
nameValue2.
Value
= "\"QUOTED STRING\"";
199
nameValue1.
Value
= "\"quoted string\"";
200
nameValue2.
Value
= "\"quoted string\"";
218
nameValue1.
Value
= null;
219
nameValue2.
Value
= null;
222
nameValue1.
Value
= "token";
223
nameValue2.
Value
= null;
226
nameValue1.
Value
= null;
227
nameValue2.
Value
= "token";
230
nameValue1.
Value
= string.Empty;
231
nameValue2.
Value
= "token";
234
nameValue1.
Value
= null;
235
nameValue2.
Value
= string.Empty;
238
nameValue1.
Value
= "token";
239
nameValue2.
Value
= "TOKEN";
242
nameValue1.
Value
= "token";
243
nameValue2.
Value
= "token";
246
nameValue1.
Value
= "\"quoted string\"";
247
nameValue2.
Value
= "\"QUOTED STRING\"";
250
nameValue1.
Value
= "\"quoted string\"";
251
nameValue2.
Value
= "\"quoted string\"";
625
header.
Value
= input;
63 references to Value
Microsoft.Net.Http.Headers (20)
CacheControlHeaderValue.cs (6)
624
success = ((nameValue.
Value
== null) || TrySetTimeSpan(nameValue, ref cc._maxStaleLimit));
700
if (nameValue.
Value
!= null)
714
if (nameValue.
Value
== null)
722
var valueString = nameValue.
Value
;
773
if (nameValue.
Value
== null)
779
if (!HeaderUtilities.TryParseNonNegativeInt32(nameValue.
Value
, out seconds))
ContentDispositionHeaderValue.cs (5)
161
var sizeString = sizeParameter.
Value
;
357
var dateString = dateParameter.
Value
;
410
if (TryDecode5987(nameParameter.
Value
, out result))
418
if (TryDecodeMime(nameParameter.
Value
, out result))
423
return HeaderUtilities.RemoveQuotes(nameParameter.
Value
);
HeaderUtilities.cs (1)
63
if (TryParseQualityDouble(qualityParameter.
Value
, 0, out var qualityValue, out _))
MediaTypeHeaderValue.cs (4)
76
return NameValueHeaderValue.Find(_parameters, CharsetString)?.
Value
?? default;
152
return NameValueHeaderValue.Find(_parameters, BoundaryString)?.
Value
?? default(StringSegment);
812
if (!StringSegment.Equals(parameter.
Value
, localParameter.
Value
, StringComparison.OrdinalIgnoreCase))
NameValueHeaderValue.cs (4)
176
/// <returns>An unescaped version of <see cref="
Value
"/>.</returns>
187
/// Sets <see cref="
Value
"/> after it has been quoted as defined by <see href="https://tools.ietf.org/html/rfc7230#section-3.2.6">the RFC specification</see>.
299
if (!StringSegment.IsNullOrEmpty(values[i].
Value
))
302
destination.Append(values[i].
Value
.AsSpan());
Microsoft.Net.Http.Headers.Tests (43)
ContentDispositionHeaderValueTest.cs (12)
136
Assert.Equal("\"=?utf-8?B?RmlsZcODTmFtZS5iYXQ=?=\"", contentDisposition.Parameters.First().
Value
.AsSpan());
151
Assert.Equal("\"=?utf-8?B?RmlsZQpOYW1lLmJhdA==?=\"", contentDisposition.Parameters.First().
Value
.AsSpan());
167
Assert.Equal("\"=?utf-99?Q?R=mlsZcODTmFtZS5iYXQ=?=\"", contentDisposition.Parameters.First().
Value
.AsSpan());
195
Assert.Equal("UTF-8\'\'new_name", contentDisposition.Parameters.First().
Value
.AsSpan());
210
Assert.Equal("UTF-8\'\'File%C3%83Name.bat", contentDisposition.Parameters.First().
Value
.AsSpan());
221
Assert.Equal($"UTF-8\'\'a%C2%80b", contentDisposition.Parameters.First().
Value
.AsSpan()); //%C2 added because the value in UTF-8 is encoded on 2 bytes.
229
Assert.Equal($"UTF-8\'\'{new string('a', 400)}", contentDisposition.Parameters.First().
Value
.AsSpan());
253
Assert.Equal($"UTF-8\'\'a%{hexC}b", contentDisposition.Parameters.First().
Value
.AsSpan());
257
Assert.Equal($"UTF-8\'\'a{(char)b}b", contentDisposition.Parameters.First().
Value
.AsSpan());
273
Assert.Equal("utf-99'lang'File%CZName.bat", contentDisposition.Parameters.First().
Value
.AsSpan());
322
Assert.Equal("\"Tue, 15 Nov 1994 08:12:32 GMT\"", contentDisposition.Parameters.First().
Value
.AsSpan());
660
Assert.Equal("UTF-8\'\'File%20%F0%9F%A4%A9%20name.txt", contentDisposition.Parameters[1].
Value
.AsSpan());
MediaTypeHeaderValueTest.cs (7)
166
Assert.Same(pair0.
Value
.Value, pair1.
Value
.Value);
194
Assert.Same(pair0.
Value
.Value, pair1.
Value
.Value);
217
Assert.Same(pair2.
Value
.Value, pair1.
Value
.Value);
273
Assert.Equal("0.563", mediaType.Parameters.First().
Value
.AsSpan());
NameValueHeaderValueTest.cs (24)
64
Assert.Null(pair0.
Value
.Value);
65
Assert.Null(pair1.
Value
.Value);
69
Assert.Equal("othervalue", pair0.
Value
.AsSpan());
70
Assert.Null(pair1.
Value
.Value);
80
Assert.Null(pair0.
Value
.Value);
81
Assert.Null(pair1.
Value
.Value);
87
Assert.Equal("othervalue", pair0.
Value
.AsSpan());
88
Assert.Null(pair1.
Value
.Value);
99
Assert.Same(pair0.
Value
.Value, pair1.
Value
.Value);
103
Assert.Equal("othervalue", pair0.
Value
.AsSpan());
104
Assert.Equal("value", pair1.
Value
.AsSpan());
114
Assert.Same(pair0.
Value
.Value, pair1.
Value
.Value);
120
Assert.Equal("othervalue", pair0.
Value
.AsSpan());
121
Assert.Equal("value", pair1.
Value
.AsSpan());
133
Assert.Same(pair0.
Value
.Value, pair1.
Value
.Value);
137
Assert.Equal("othervalue", pair2.
Value
.AsSpan());
138
Assert.Equal("value", pair1.
Value
.AsSpan());
603
var actual = header.
Value
;
629
var actual = header.
Value
;
643
var actual = header.
Value
;
676
Assert.Equal(value.AsSpan(), nameValue.
Value
);