diff --git a/tests/Shared/LayoutRenderers/TestInvolvingAspNetHttpContext.cs b/tests/Shared/LayoutRenderers/TestInvolvingAspNetHttpContext.cs index 4cd25d35..368b6d68 100644 --- a/tests/Shared/LayoutRenderers/TestInvolvingAspNetHttpContext.cs +++ b/tests/Shared/LayoutRenderers/TestInvolvingAspNetHttpContext.cs @@ -35,7 +35,7 @@ protected TestInvolvingAspNetHttpContext() HttpContext.Current = HttpContext; #endif } - + /// /// Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources. /// @@ -73,28 +73,6 @@ protected virtual HttpRequest SetUpHttpRequest(Uri uri = null) return new HttpRequest("", uri.AbsoluteUri, uri.Query); } - protected void AddRequestHeader(HttpRequest request, string headerName, string headerValue) - { - // thanks http://stackoverflow.com/a/13307238 - var headers = request.Headers; - var t = headers.GetType(); - var item = new ArrayList(); - - t.InvokeMember("MakeReadWrite", BindingFlags.InvokeMethod | BindingFlags.NonPublic | BindingFlags.Instance, - null, - headers, null); - t.InvokeMember("InvalidateCachedArrays", - BindingFlags.InvokeMethod | BindingFlags.NonPublic | BindingFlags.Instance, - null, headers, null); - item.Add(headerValue); - t.InvokeMember("BaseAdd", BindingFlags.InvokeMethod | BindingFlags.NonPublic | BindingFlags.Instance, null, - headers, - new object[] { headerName, item }); - t.InvokeMember("MakeReadOnly", BindingFlags.InvokeMethod | BindingFlags.NonPublic | BindingFlags.Instance, - null, - headers, null); - } - protected virtual HttpResponse SetUpHttpResponse() { var stringWriter = new StringWriter(); @@ -112,12 +90,6 @@ protected HttpContext SetUpFakeHttpContext() return context; } - protected void AddRequestHeader(HttpRequest request, string headerName, params string[] headerValues) - { - var headers = request.Headers; - headers.Add(headerName, headerValues); - } - protected virtual HttpRequest SetUpHttpRequest(HttpContext context) { var httpRequest = NSubstitute.Substitute.For();