提交 861ab4c9 编写于 作者: M Marcos Henrich

[System.Web] Test HttpRequest.Headers Add/Set/Remove

In .NET while calling Add, Set or Remove of a HttpRequest read only
collection a PlatformNotSupportedException is thrown.

Covers #33809
上级 e2a79ed8
......@@ -254,6 +254,30 @@ namespace MonoTests.System.Web {
{
HttpContext.Current.Request.MapPath ("Web.config", "something", false);
}
[Test]
[ExpectedException (typeof (PlatformNotSupportedException))]
public void ReadOnlyHeadersAdd ()
{
var r = new HttpRequest ("file", "http://www.gnome.org", "key=value&key2=value%32second");
r.Headers.Add ("a","a");
}
[Test]
[ExpectedException (typeof (PlatformNotSupportedException))]
public void ReadOnlyHeadersSet ()
{
var r = new HttpRequest ("file", "http://www.gnome.org", "key=value&key2=value%32second");
r.Headers.Set ("a","a");
}
[Test]
[ExpectedException (typeof (PlatformNotSupportedException))]
public void ReadOnlyHeadersRemove ()
{
var r = new HttpRequest ("file", "http://www.gnome.org", "key=value&key2=value%32second");
r.Headers.Remove ("a");
}
}
[TestFixture]
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册