parent
0f0999161d
commit
3f9c23a6ee
|
|
@ -3,7 +3,6 @@
|
|||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using System.Diagnostics.Contracts;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
|
|
@ -37,7 +36,7 @@ namespace Microsoft.AspNet.TestHost
|
|||
{
|
||||
throw new ArgumentNullException(nameof(application));
|
||||
}
|
||||
|
||||
|
||||
_application = application;
|
||||
|
||||
// PathString.StartsWithSegments that we use below requires the base path to not end in a slash.
|
||||
|
|
@ -204,8 +203,6 @@ namespace Microsoft.AspNet.TestHost
|
|||
}
|
||||
}
|
||||
|
||||
[SuppressMessage("Microsoft.Reliability", "CA2000:DisposeObjectsBeforeLosingScope",
|
||||
Justification = "HttpResposneMessage must be returned to the caller.")]
|
||||
private HttpResponseMessage GenerateResponse()
|
||||
{
|
||||
_responseFeature.FireOnSendingHeaders();
|
||||
|
|
|
|||
|
|
@ -2,7 +2,6 @@
|
|||
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
|
||||
|
||||
using System;
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using System.IO;
|
||||
using System.Net.Http;
|
||||
using System.Threading.Tasks;
|
||||
|
|
@ -12,8 +11,6 @@ namespace Microsoft.AspNet.TestHost
|
|||
/// <summary>
|
||||
/// Used to construct a HttpRequestMessage object.
|
||||
/// </summary>
|
||||
[SuppressMessage("Microsoft.Design", "CA1001:TypesThatOwnDisposableFieldsShouldBeDisposable",
|
||||
Justification = "HttpRequestMessage is disposed by HttpClient in SendAsync")]
|
||||
public class RequestBuilder
|
||||
{
|
||||
private readonly TestServer _server;
|
||||
|
|
@ -24,7 +21,6 @@ namespace Microsoft.AspNet.TestHost
|
|||
/// </summary>
|
||||
/// <param name="server"></param>
|
||||
/// <param name="path"></param>
|
||||
[SuppressMessage("Microsoft.Usage", "CA2234:PassSystemUriObjectsInsteadOfStrings", Justification = "Not a full URI")]
|
||||
public RequestBuilder(TestServer server, string path)
|
||||
{
|
||||
if (server == null)
|
||||
|
|
@ -90,7 +86,6 @@ namespace Microsoft.AspNet.TestHost
|
|||
/// Set the request method to GET and start processing the request.
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
[SuppressMessage("Microsoft.Design", "CA1024:UsePropertiesWhereAppropriate", Justification = "GET is an HTTP verb.")]
|
||||
public Task<HttpResponseMessage> GetAsync()
|
||||
{
|
||||
_req.Method = HttpMethod.Get;
|
||||
|
|
|
|||
|
|
@ -3,7 +3,6 @@
|
|||
|
||||
using System;
|
||||
using System.Collections.Concurrent;
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using System.Diagnostics.Contracts;
|
||||
using System.IO;
|
||||
using System.Threading;
|
||||
|
|
@ -370,8 +369,6 @@ namespace Microsoft.AspNet.TestHost
|
|||
}
|
||||
}
|
||||
|
||||
[SuppressMessage("Microsoft.Usage", "CA2213:DisposableFieldsShouldBeDisposed", MessageId = "_writeLock", Justification = "ODEs from the locks would mask IOEs from abort.")]
|
||||
[SuppressMessage("Microsoft.Usage", "CA2213:DisposableFieldsShouldBeDisposed", MessageId = "_readLock", Justification = "Data can still be read unless we get aborted.")]
|
||||
protected override void Dispose(bool disposing)
|
||||
{
|
||||
if (disposing)
|
||||
|
|
|
|||
Loading…
Reference in New Issue