2 // WebHeaderCollectionTest.cs - NUnit Test Cases for System.Net.WebHeaderCollection
5 // Lawrence Pit (loz@cable.a2000.nl)
6 // Martin Willemoes Hansen (mwh@sysrq.dk)
7 // Gert Driesen (drieseng@users.sourceforge.net)
8 // Gonzalo Paniagua Javier (gonzalo@novell.com)
10 // (C) 2003 Martin Willemoes Hansen
14 using System.Collections;
15 using System.Collections.Specialized;
18 using System.Runtime.Serialization;
19 using System.Runtime.Serialization.Formatters;
20 using System.Runtime.Serialization.Formatters.Binary;
22 using NUnit.Framework;
24 namespace MonoTests.System.Net
27 public class WebHeaderCollectionTest
29 WebHeaderCollection col;
32 public void GetReady ()
34 col = new WebHeaderCollection ();
35 col.Add ("Name1: Value1");
36 col.Add ("Name2: Value2");
45 } catch (ArgumentNullException) { }
49 } catch (ArgumentException) { }
53 } catch (ArgumentException) { }
57 } catch (ArgumentException) { }
61 } catch (ArgumentException) { }
64 col.Add ("XHost: foo");
65 } catch (ArgumentException) {
71 col.Add ("XHost" + ((char) 0xa9) + ": foo");
73 } catch (ArgumentException) { }
75 col.Add ("XHost: foo" + (char) 0xa9);
76 } catch (ArgumentException) {
80 col.Add ("XHost: foo" + (char) 0x7f);
82 } catch (ArgumentException) {
87 col.Add ("XHost", null);
88 } catch (ArgumentException) {
93 } catch (ArgumentException) {
99 // this can only be tested in namespace System.Net
101 WebHeaderCollection col2 = new WebHeaderCollection (true);
102 col2.Add ("Host: foo");
103 Assert.Fail ("#13: should fail according to spec");
104 } catch (ArgumentException) {}
109 [Category ("NotWorking")]
110 public void GetValues ()
112 WebHeaderCollection w = new WebHeaderCollection ();
113 w.Add ("Hello", "H1");
114 w.Add ("Hello", "H2");
115 w.Add ("Hello", "H3,H4");
117 string [] sa = w.GetValues ("Hello");
118 Assert.AreEqual (3, sa.Length, "#1");
119 Assert.AreEqual ("H1, H2,H3,H4", w.Get ("Hello"), "#2");
121 w = new WebHeaderCollection ();
122 w.Add ("Accept", "H1");
123 w.Add ("Accept", "H2");
124 w.Add ("Accept", "H3,H4");
125 Assert.AreEqual (3, w.GetValues (0).Length, "#3a");
126 Assert.AreEqual (4, w.GetValues ("Accept").Length, "#3b");
127 Assert.AreEqual ("H1, H2,H3,H4", w.Get ("Accept"), "#4");
129 w = new WebHeaderCollection ();
130 w.Add ("Allow", "H1");
131 w.Add ("Allow", "H2");
132 w.Add ("Allow", "H3,H4");
133 sa = w.GetValues ("Allow");
134 Assert.AreEqual (4, sa.Length, "#5");
135 Assert.AreEqual ("H1, H2,H3,H4", w.Get ("Allow"), "#6");
137 w = new WebHeaderCollection ();
138 w.Add ("AUTHorization", "H1, H2, H3");
139 sa = w.GetValues ("authorization");
140 Assert.AreEqual (3, sa.Length, "#9");
142 w = new WebHeaderCollection ();
143 w.Add ("proxy-authenticate", "H1, H2, H3");
144 sa = w.GetValues ("Proxy-Authenticate");
145 Assert.AreEqual (3, sa.Length, "#9");
147 w = new WebHeaderCollection ();
148 w.Add ("expect", "H1,\tH2, H3 ");
149 sa = w.GetValues ("EXPECT");
150 Assert.AreEqual (3, sa.Length, "#10");
151 Assert.AreEqual ("H2", sa [1], "#11");
152 Assert.AreEqual ("H3", sa [2], "#12");
157 } catch (ArgumentNullException) { }
158 Assert.AreEqual (null, w.GetValues (""), "#14");
159 Assert.AreEqual (null, w.GetValues ("NotExistent"), "#15");
163 public void Indexers ()
165 Assert.AreEqual ("Value1", ((NameValueCollection)col)[0], "#1.1");
166 //FIXME: test also HttpRequestHeader and HttpResponseHeader
167 //FIXME: is this enough?
168 WebHeaderCollection w = new WebHeaderCollection ();
169 w [HttpRequestHeader.CacheControl] = "Value2";
170 Assertion.AssertEquals ("#1.2", "Value2", w [HttpRequestHeader.CacheControl]);
171 w [HttpResponseHeader.Pragma] = "Value3";
172 Assertion.AssertEquals ("#1.3", "Value3", w [HttpResponseHeader.Pragma]);
176 public void Remove ()
178 col.Remove ("Name1");
179 col.Remove ("NameNotExist");
180 Assert.AreEqual (1, col.Count, "#1");
183 // this can only be tested in namespace System.Net
185 WebHeaderCollection col2 = new WebHeaderCollection (true);
186 col2.Add ("Host", "foo");
187 col2.Remove ("Host");
188 Assert.Fail ("#2: should fail according to spec");
189 } catch (ArgumentException) {}
196 col.Add ("Name1", "Value1b");
197 col.Set ("Name1", "\t X \t");
198 Assert.AreEqual ("X", col.Get ("Name1"), "#1");
202 public void IsRestricted ()
204 Assert.IsTrue (!WebHeaderCollection.IsRestricted ("Xhost"), "#1");
205 Assert.IsTrue (WebHeaderCollection.IsRestricted ("Host"), "#2");
206 Assert.IsTrue (WebHeaderCollection.IsRestricted ("HOST"), "#3");
207 Assert.IsTrue (WebHeaderCollection.IsRestricted ("Transfer-Encoding"), "#4");
208 Assert.IsTrue (WebHeaderCollection.IsRestricted ("user-agent"), "#5");
209 Assert.IsTrue (WebHeaderCollection.IsRestricted ("accept"), "#6");
210 Assert.IsTrue (!WebHeaderCollection.IsRestricted ("accept-charset"), "#7");
214 public void ToStringTest ()
216 col.Add ("Name1", "Value1b");
217 col.Add ("Name3", "Value3a\r\n Value3b");
218 col.Add ("Name4", " Value4 ");
219 Assert.AreEqual ("Name1: Value1,Value1b\r\nName2: Value2\r\nName3: Value3a\r\n Value3b\r\nName4: Value4\r\n\r\n", col.ToString (), "#1");
220 WebHeaderCollection w;
221 w = new WebHeaderCollection ();
222 w.Add (HttpResponseHeader.KeepAlive, "Value1");
223 w.Add (HttpResponseHeader.WwwAuthenticate, "Value2");
224 Assertion.AssertEquals ("#2", "Keep-Alive: Value1\r\nWWW-Authenticate: Value2\r\n\r\n", w.ToString ());
225 w = new WebHeaderCollection ();
226 w.Add (HttpRequestHeader.UserAgent, "Value1");
227 w.Add (HttpRequestHeader.ContentMd5, "Value2");
228 Assertion.AssertEquals ("#2", "User-Agent: Value1\r\nContent-MD5: Value2\r\n\r\n", w.ToString ());
233 //FIXME: include Java serialization compliant tests - the order of object
234 // in SerializationInfo should stay same to MS format...
235 [Ignore ("The MS compliant binary serialization is not supported")]
237 public void GetObjectData ()
239 SerializationInfo si = new SerializationInfo (typeof (WebHeaderCollection),
240 new FormatterConverter ());
242 WebHeaderCollection headers = new WebHeaderCollection ();
243 headers.Add ("Content-Type", "image/png");
244 headers.Add ("No-Cache:off");
245 headers.Add ("Disposition", "attach");
247 ((ISerializable) headers).GetObjectData (si, new StreamingContext ());
248 Assert.AreEqual (7, si.MemberCount, "#A");
250 foreach (SerializationEntry entry in si) {
251 Assert.IsNotNull (entry.Name, "#B1:" + i);
252 Assert.IsNotNull (entry.ObjectType, "#B2:" + i);
253 Assert.IsNotNull (entry.Value, "#B3:" + i);
257 Assert.AreEqual ("Count", entry.Name, "#B4:" + i);
258 Assert.AreEqual (typeof (int), entry.ObjectType, "#B5:" + i);
259 Assert.AreEqual (3, entry.Value, "#B6:" + i);
262 Assert.AreEqual ("0", entry.Name, "#B4:" + i);
263 Assert.AreEqual (typeof (string), entry.ObjectType, "#B5:" + i);
264 Assert.AreEqual ("Content-Type", entry.Value, "#B6:" + i);
267 Assert.AreEqual ("3", entry.Name, "#B4:" + i);
268 Assert.AreEqual (typeof (string), entry.ObjectType, "#B5:" + i);
269 Assert.AreEqual ("image/png", entry.Value, "#B6:" + i);
272 Assert.AreEqual ("1", entry.Name, "#B4:" + i);
273 Assert.AreEqual (typeof (string), entry.ObjectType, "#B5:" + i);
274 Assert.AreEqual ("No-Cache", entry.Value, "#B6:" + i);
277 Assert.AreEqual ("4", entry.Name, "#B4:" + i);
278 Assert.AreEqual (typeof (string), entry.ObjectType, "#B5:" + i);
279 Assert.AreEqual ("off", entry.Value, "#B6:" + i);
282 Assert.AreEqual ("2", entry.Name, "#B4:" + i);
283 Assert.AreEqual (typeof (string), entry.ObjectType, "#B5:" + i);
284 Assert.AreEqual ("Disposition", entry.Value, "#B6:" + i);
287 Assert.AreEqual ("5", entry.Name, "#B4:" + i);
288 Assert.AreEqual (typeof (string), entry.ObjectType, "#B5:" + i);
289 Assert.AreEqual ("attach", entry.Value, "#B6:" + i);
298 //FIXME: include Java serialization compliant tests
299 [Ignore ("The MS compliant binary serialization is not supported")]
301 public void Serialize ()
303 WebHeaderCollection headers = new WebHeaderCollection ();
304 headers.Add ("Content-Type", "image/png");
305 headers.Add ("No-Cache:off");
306 headers.Add ("Disposition", "attach");
308 BinaryFormatter bf = new BinaryFormatter ();
309 bf.AssemblyFormat = FormatterAssemblyStyle.Full;
311 MemoryStream ms = new MemoryStream ();
312 bf.Serialize (ms, headers);
315 byte [] buffer = new byte [ms.Length];
316 ms.Read (buffer, 0, buffer.Length);
317 Assert.AreEqual (_serialized, buffer);
322 //FIXME: include Java serialization compliant tests
323 [Ignore ("The MS compliant binary serialization format is not supported")]
325 public void Deserialize ()
327 MemoryStream ms = new MemoryStream ();
328 ms.Write (_serialized, 0, _serialized.Length);
331 BinaryFormatter bf = new BinaryFormatter ();
332 WebHeaderCollection headers = (WebHeaderCollection) bf.Deserialize (ms);
335 private static readonly byte [] _serialized = new byte [] {
337 0x00, 0x01, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0x01, 0x00,
338 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0c, 0x02, 0x00, 0x00, 0x00,
339 0x49, 0x53, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x2c, 0x20, 0x56, 0x65,
341 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x3d, 0x34, 0x2e, 0x30, 0x2e, 0x30,
343 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x3d, 0x32, 0x2e, 0x30, 0x2e, 0x30,
345 0x2e, 0x30, 0x2c, 0x20, 0x43, 0x75, 0x6c, 0x74, 0x75, 0x72, 0x65,
346 0x3d, 0x6e, 0x65, 0x75, 0x74, 0x72, 0x61, 0x6c, 0x2c, 0x20, 0x50,
347 0x75, 0x62, 0x6c, 0x69, 0x63, 0x4b, 0x65, 0x79, 0x54, 0x6f, 0x6b,
348 0x65, 0x6e, 0x3d, 0x62, 0x37, 0x37, 0x61, 0x35, 0x63, 0x35, 0x36,
349 0x31, 0x39, 0x33, 0x34, 0x65, 0x30, 0x38, 0x39, 0x05, 0x01, 0x00,
350 0x00, 0x00, 0x1e, 0x53, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x2e, 0x4e,
351 0x65, 0x74, 0x2e, 0x57, 0x65, 0x62, 0x48, 0x65, 0x61, 0x64, 0x65,
352 0x72, 0x43, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e,
353 0x07, 0x00, 0x00, 0x00, 0x05, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x01,
354 0x30, 0x01, 0x33, 0x01, 0x31, 0x01, 0x34, 0x01, 0x32, 0x01, 0x35,
355 0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x08, 0x02, 0x00, 0x00,
356 0x00, 0x03, 0x00, 0x00, 0x00, 0x06, 0x03, 0x00, 0x00, 0x00, 0x0c,
357 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x2d, 0x54, 0x79, 0x70,
358 0x65, 0x06, 0x04, 0x00, 0x00, 0x00, 0x09, 0x69, 0x6d, 0x61, 0x67,
359 0x65, 0x2f, 0x70, 0x6e, 0x67, 0x06, 0x05, 0x00, 0x00, 0x00, 0x08,
360 0x4e, 0x6f, 0x2d, 0x43, 0x61, 0x63, 0x68, 0x65, 0x06, 0x06, 0x00,
361 0x00, 0x00, 0x03, 0x6f, 0x66, 0x66, 0x06, 0x07, 0x00, 0x00, 0x00,
362 0x0b, 0x44, 0x69, 0x73, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f,
363 0x6e, 0x06, 0x08, 0x00, 0x00, 0x00, 0x06, 0x61, 0x74, 0x74, 0x61,
366 0x00, 0x01, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0x01, 0x00,
367 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0c, 0x02, 0x00, 0x00, 0x00,
368 0x4c, 0x53, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x2c, 0x20, 0x56, 0x65,
369 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x3d, 0x31, 0x2e, 0x30, 0x2e, 0x35,
370 0x30, 0x30, 0x30, 0x2e, 0x30, 0x2c, 0x20, 0x43, 0x75, 0x6c, 0x74,
371 0x75, 0x72, 0x65, 0x3d, 0x6e, 0x65, 0x75, 0x74, 0x72, 0x61, 0x6c,
372 0x2c, 0x20, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x4b, 0x65, 0x79,
373 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x3d, 0x62, 0x37, 0x37, 0x61, 0x35,
374 0x63, 0x35, 0x36, 0x31, 0x39, 0x33, 0x34, 0x65, 0x30, 0x38, 0x39,
375 0x05, 0x01, 0x00, 0x00, 0x00, 0x1e, 0x53, 0x79, 0x73, 0x74, 0x65,
376 0x6d, 0x2e, 0x4e, 0x65, 0x74, 0x2e, 0x57, 0x65, 0x62, 0x48, 0x65,
377 0x61, 0x64, 0x65, 0x72, 0x43, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74,
378 0x69, 0x6f, 0x6e, 0x07, 0x00, 0x00, 0x00, 0x05, 0x43, 0x6f, 0x75,
379 0x6e, 0x74, 0x01, 0x30, 0x01, 0x33, 0x01, 0x31, 0x01, 0x34, 0x01,
380 0x32, 0x01, 0x35, 0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x08,
381 0x02, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x06, 0x03, 0x00,
382 0x00, 0x00, 0x0c, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x2d,
383 0x54, 0x79, 0x70, 0x65, 0x06, 0x04, 0x00, 0x00, 0x00, 0x09, 0x69,
384 0x6d, 0x61, 0x67, 0x65, 0x2f, 0x70, 0x6e, 0x67, 0x06, 0x05, 0x00,
385 0x00, 0x00, 0x08, 0x4e, 0x6f, 0x2d, 0x43, 0x61, 0x63, 0x68, 0x65,
386 0x06, 0x06, 0x00, 0x00, 0x00, 0x03, 0x6f, 0x66, 0x66, 0x06, 0x07,
387 0x00, 0x00, 0x00, 0x0b, 0x44, 0x69, 0x73, 0x70, 0x6f, 0x73, 0x69,
388 0x74, 0x69, 0x6f, 0x6e, 0x06, 0x08, 0x00, 0x00, 0x00, 0x06, 0x61,
389 0x74, 0x74, 0x61, 0x63, 0x68, 0x0b
394 public void IsRestricted_InvalidChars_1 ()
406 int [] singles = new int [] { 34, 44, 47, 123, 125 };
407 foreach (int single in singles) {
409 WebHeaderCollection.IsRestricted (new string ((char) single, 1));
410 Assert.Fail (String.Format ("{0}: {1}", single, (char) single));
411 } catch (ArgumentException) {
414 for (int i = 0; i <= 32; i++) {
416 WebHeaderCollection.IsRestricted (new string ((char) i, 1));
417 Assert.Fail (String.Format ("{0}: {1}", i, (char) i));
418 } catch (ArgumentException) {
421 for (int i = 39; i <= 41; i++) {
423 WebHeaderCollection.IsRestricted (new string ((char) i, 1));
424 Assert.Fail (String.Format ("{0}: {1}", i, (char) i));
425 } catch (ArgumentException) {
428 for (int i = 91; i <= 93; i++) {
430 WebHeaderCollection.IsRestricted (new string ((char) i, 1));
431 Assert.Fail (String.Format ("{0}: {1}", i, (char) i));
432 } catch (ArgumentException) {
435 for (int i = 127; i <= 255; i++) {
437 WebHeaderCollection.IsRestricted (new string ((char) i, 1));
438 Assert.Fail (String.Format ("{0}: {1}", i, (char) i));
439 } catch (ArgumentException) {
445 public void IsRestricted_InvalidChars_Request_2 ()
457 int [] singles = new int [] { 34, 44, 47, 123, 125 };
458 foreach (int single in singles) {
460 WebHeaderCollection.IsRestricted (new string ((char) single, 1), false);
461 Assert.Fail (String.Format ("{0}: {1}", single, (char) single));
462 } catch (ArgumentException) {
465 for (int i = 0; i <= 32; i++) {
467 WebHeaderCollection.IsRestricted (new string ((char) i, 1), false);
468 Assert.Fail (String.Format ("{0}: {1}", i, (char) i));
469 } catch (ArgumentException) {
472 for (int i = 39; i <= 41; i++) {
474 WebHeaderCollection.IsRestricted (new string ((char) i, 1), false);
475 Assert.Fail (String.Format ("{0}: {1}", i, (char) i));
476 } catch (ArgumentException) {
479 for (int i = 91; i <= 93; i++) {
481 WebHeaderCollection.IsRestricted (new string ((char) i, 1), false);
482 Assert.Fail (String.Format ("{0}: {1}", i, (char) i));
483 } catch (ArgumentException) {
486 for (int i = 127; i <= 255; i++) {
488 WebHeaderCollection.IsRestricted (new string ((char) i, 1), false);
489 Assert.Fail (String.Format ("{0}: {1}", i, (char) i));
490 } catch (ArgumentException) {
496 public void IsRestricted_InvalidChars_Response_2 ()
508 int [] singles = new int [] { 34, 44, 47, 123, 125 };
509 foreach (int single in singles) {
511 WebHeaderCollection.IsRestricted (new string ((char) single, 1), true);
512 Assert.Fail (String.Format ("{0}: {1}", single, (char) single));
513 } catch (ArgumentException) {
516 for (int i = 0; i <= 32; i++) {
518 WebHeaderCollection.IsRestricted (new string ((char) i, 1), true);
519 Assert.Fail (String.Format ("{0}: {1}", i, (char) i));
520 } catch (ArgumentException) {
523 for (int i = 39; i <= 41; i++) {
525 WebHeaderCollection.IsRestricted (new string ((char) i, 1), true);
526 Assert.Fail (String.Format ("{0}: {1}", i, (char) i));
527 } catch (ArgumentException) {
530 for (int i = 91; i <= 93; i++) {
532 WebHeaderCollection.IsRestricted (new string ((char) i, 1), true);
533 Assert.Fail (String.Format ("{0}: {1}", i, (char) i));
534 } catch (ArgumentException) {
537 for (int i = 127; i <= 255; i++) {
539 WebHeaderCollection.IsRestricted (new string ((char) i, 1), true);
540 Assert.Fail (String.Format ("{0}: {1}", i, (char) i));
541 } catch (ArgumentException) {
546 static string [] request_headers = new string [] {
547 "Accept", "Accept-Charset", "Accept-Encoding", "Accept-Language", "Accept-Ranges", "Authorization",
548 "Cache-Control", "Connection", "Cookie", "Content-Length", "Content-Type", "Date",
549 "Expect", "From", "Host", "If-Match", "If-Modified-Since", "If-None-Match",
550 "If-Range", "If-Unmodified-Since", "Max-Forwards", "Pragma", "Proxy-Authorization",
551 "Range", "Referer", "TE", "Upgrade", "User-Agent", "Via", "Warn" };
553 static string [] response_headers = new string [] {
554 "Accept-Ranges", "Age", "Allow", "Cache-Control", "Content-Encoding", "Content-Language",
555 "Content-Length", "Content-Location", "Content-Disposition", "Content-MD5", "Content-Range",
556 "Content-Type", "Date", "ETag", "Expires", "Last-Modified", "Location", "Pragma",
557 "Proxy-Authenticate", "Retry-After", "Server", "Set-Cookie", "Trailer",
558 "Transfer-Encoding", "Vary", "Via", "Warn", "WWW-Authenticate" };
560 static string [] restricted_request_request = new string [] {
561 "Accept", "Connection", "Content-Length", "Content-Type", "Date",
562 "Expect", "Host", "If-Modified-Since", "Range", "Referer",
564 static string [] restricted_response_request = new string [] {
565 "Content-Length", "Content-Type", "Date", "Transfer-Encoding" };
567 static string [] restricted_request_response = new string [] {
569 static string [] restricted_response_response = new string [] {
570 "Content-Length", "Transfer-Encoding", "WWW-Authenticate" };
573 public void IsRestricted_2_0_RequestRequest ()
576 foreach (string str in request_headers) {
577 if (WebHeaderCollection.IsRestricted (str, false)) {
578 Assert.IsTrue (Array.IndexOf (restricted_request_request, str) != -1, "restricted " + str);
581 Assert.IsTrue (Array.IndexOf (restricted_request_request, str) == -1, str);
584 Assert.IsTrue (count == restricted_request_request.Length, "req-req length");
588 public void IsRestricted_2_0_ResponseRequest ()
591 foreach (string str in response_headers) {
592 if (WebHeaderCollection.IsRestricted (str, false)) {
593 Assert.IsTrue (Array.IndexOf (restricted_response_request, str) != -1, "restricted " + str);
596 Assert.IsTrue (Array.IndexOf (restricted_response_request, str) == -1, str);
599 Assert.IsTrue (count == restricted_response_request.Length, "length");
603 public void IsRestricted_2_0_RequestResponse ()
606 foreach (string str in request_headers) {
607 if (WebHeaderCollection.IsRestricted (str, true)) {
608 Assert.IsTrue (Array.IndexOf (restricted_request_response, str) != -1, "restricted " + str);
611 Assert.IsTrue (Array.IndexOf (restricted_request_response, str) == -1, str);
614 Assert.IsTrue (count == restricted_request_response.Length, "length");
618 public void IsRestricted_2_0_ResponseResponse ()
621 foreach (string str in response_headers) {
622 if (WebHeaderCollection.IsRestricted (str, true)) {
623 Assert.IsTrue (Array.IndexOf (restricted_response_response, str) != -1, "restricted " + str);
626 Assert.IsTrue (Array.IndexOf (restricted_response_response, str) == -1, str);
629 Assert.IsTrue (count == restricted_response_response.Length, "length");