Skip to content

Commit

Permalink
cleanup deadcode
Browse files Browse the repository at this point in the history
  • Loading branch information
304NotModified committed Apr 25, 2020
1 parent 892bfd9 commit 66214e5
Showing 1 changed file with 1 addition and 29 deletions.
30 changes: 1 addition & 29 deletions tests/Shared/LayoutRenderers/TestInvolvingAspNetHttpContext.cs
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ protected TestInvolvingAspNetHttpContext()
HttpContext.Current = HttpContext;
#endif
}

/// <summary>
/// Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
/// </summary>
Expand Down Expand Up @@ -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();
Expand All @@ -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<HttpRequest>();
Expand Down

0 comments on commit 66214e5

Please sign in to comment.