Dispose FileWatcher in tests
This commit is contained in:
parent
dcb520f567
commit
a7a6a90f1d
|
|
@ -24,7 +24,7 @@ namespace Microsoft.AspNet.StaticFiles
|
|||
StaticFilesTestServer.Create(app => app.UseDefaultFiles(new DefaultFilesOptions() { FileProvider = null }));
|
||||
|
||||
// PathString(null) is OK.
|
||||
TestServer server = StaticFilesTestServer.Create(app => app.UseDefaultFiles((string)null));
|
||||
var server = StaticFilesTestServer.Create(app => app.UseDefaultFiles((string)null));
|
||||
var response = await server.CreateClient().GetAsync("/");
|
||||
Assert.Equal(HttpStatusCode.NotFound, response.StatusCode);
|
||||
}
|
||||
|
|
@ -52,19 +52,22 @@ namespace Microsoft.AspNet.StaticFiles
|
|||
|
||||
public async Task NoMatch_PassesThrough(string baseUrl, string baseDir, string requestUrl)
|
||||
{
|
||||
TestServer server = StaticFilesTestServer.Create(app =>
|
||||
using (var fileProvider = new PhysicalFileProvider(Path.Combine(Directory.GetCurrentDirectory(), baseDir)))
|
||||
{
|
||||
app.UseDefaultFiles(new DefaultFilesOptions()
|
||||
var server = StaticFilesTestServer.Create(app =>
|
||||
{
|
||||
RequestPath = new PathString(baseUrl),
|
||||
FileProvider = new PhysicalFileProvider(Path.Combine(Directory.GetCurrentDirectory(), baseDir))
|
||||
app.UseDefaultFiles(new DefaultFilesOptions()
|
||||
{
|
||||
RequestPath = new PathString(baseUrl),
|
||||
FileProvider = fileProvider
|
||||
});
|
||||
app.Run(context => context.Response.WriteAsync(context.Request.Path.Value));
|
||||
});
|
||||
app.Run(context => context.Response.WriteAsync(context.Request.Path.Value));
|
||||
});
|
||||
|
||||
var response = await server.CreateClient().GetAsync(requestUrl);
|
||||
Assert.Equal(HttpStatusCode.OK, response.StatusCode);
|
||||
Assert.Equal(requestUrl, await response.Content.ReadAsStringAsync()); // Should not be modified
|
||||
var response = await server.CreateClient().GetAsync(requestUrl);
|
||||
Assert.Equal(HttpStatusCode.OK, response.StatusCode);
|
||||
Assert.Equal(requestUrl, await response.Content.ReadAsStringAsync()); // Should not be modified
|
||||
}
|
||||
}
|
||||
|
||||
[Theory]
|
||||
|
|
@ -88,19 +91,22 @@ namespace Microsoft.AspNet.StaticFiles
|
|||
|
||||
public async Task FoundDirectoryWithDefaultFile_PathModified(string baseUrl, string baseDir, string requestUrl)
|
||||
{
|
||||
TestServer server = StaticFilesTestServer.Create(app =>
|
||||
using (var fileProvider = new PhysicalFileProvider(Path.Combine(Directory.GetCurrentDirectory(), baseDir)))
|
||||
{
|
||||
app.UseDefaultFiles(new DefaultFilesOptions()
|
||||
var server = StaticFilesTestServer.Create(app =>
|
||||
{
|
||||
RequestPath = new PathString(baseUrl),
|
||||
FileProvider = new PhysicalFileProvider(Path.Combine(Directory.GetCurrentDirectory(), baseDir))
|
||||
app.UseDefaultFiles(new DefaultFilesOptions()
|
||||
{
|
||||
RequestPath = new PathString(baseUrl),
|
||||
FileProvider = fileProvider
|
||||
});
|
||||
app.Run(context => context.Response.WriteAsync(context.Request.Path.Value));
|
||||
});
|
||||
app.Run(context => context.Response.WriteAsync(context.Request.Path.Value));
|
||||
});
|
||||
|
||||
var response = await server.CreateClient().GetAsync(requestUrl);
|
||||
Assert.Equal(HttpStatusCode.OK, response.StatusCode);
|
||||
Assert.Equal(requestUrl + "default.html", await response.Content.ReadAsStringAsync()); // Should be modified
|
||||
var response = await server.CreateClient().GetAsync(requestUrl);
|
||||
Assert.Equal(HttpStatusCode.OK, response.StatusCode);
|
||||
Assert.Equal(requestUrl + "default.html", await response.Content.ReadAsStringAsync()); // Should be modified
|
||||
}
|
||||
}
|
||||
|
||||
[Theory]
|
||||
|
|
@ -124,16 +130,19 @@ namespace Microsoft.AspNet.StaticFiles
|
|||
|
||||
public async Task NearMatch_RedirectAddSlash(string baseUrl, string baseDir, string requestUrl, string queryString)
|
||||
{
|
||||
TestServer server = StaticFilesTestServer.Create(app => app.UseDefaultFiles(new DefaultFilesOptions()
|
||||
using (var fileProvider = new PhysicalFileProvider(Path.Combine(Directory.GetCurrentDirectory(), baseDir)))
|
||||
{
|
||||
RequestPath = new PathString(baseUrl),
|
||||
FileProvider = new PhysicalFileProvider(Path.Combine(Directory.GetCurrentDirectory(), baseDir))
|
||||
}));
|
||||
HttpResponseMessage response = await server.CreateRequest(requestUrl + queryString).GetAsync();
|
||||
var server = StaticFilesTestServer.Create(app => app.UseDefaultFiles(new DefaultFilesOptions()
|
||||
{
|
||||
RequestPath = new PathString(baseUrl),
|
||||
FileProvider = fileProvider
|
||||
}));
|
||||
var response = await server.CreateRequest(requestUrl + queryString).GetAsync();
|
||||
|
||||
Assert.Equal(HttpStatusCode.Moved, response.StatusCode);
|
||||
Assert.Equal(requestUrl + "/" + queryString, response.Headers.GetValues("Location").FirstOrDefault());
|
||||
Assert.Equal(0, (await response.Content.ReadAsByteArrayAsync()).Length);
|
||||
Assert.Equal(HttpStatusCode.Moved, response.StatusCode);
|
||||
Assert.Equal(requestUrl + "/" + queryString, response.Headers.GetValues("Location").FirstOrDefault());
|
||||
Assert.Equal(0, (await response.Content.ReadAsByteArrayAsync()).Length);
|
||||
}
|
||||
}
|
||||
|
||||
[Theory]
|
||||
|
|
@ -159,14 +168,17 @@ namespace Microsoft.AspNet.StaticFiles
|
|||
|
||||
public async Task PostDirectory_PassesThrough(string baseUrl, string baseDir, string requestUrl)
|
||||
{
|
||||
TestServer server = StaticFilesTestServer.Create(app => app.UseDefaultFiles(new DefaultFilesOptions()
|
||||
using (var fileProvder = new PhysicalFileProvider(Path.Combine(Directory.GetCurrentDirectory(), baseDir)))
|
||||
{
|
||||
RequestPath = new PathString(baseUrl),
|
||||
FileProvider = new PhysicalFileProvider(Path.Combine(Directory.GetCurrentDirectory(), baseDir))
|
||||
}));
|
||||
HttpResponseMessage response = await server.CreateRequest(requestUrl).GetAsync();
|
||||
var server = StaticFilesTestServer.Create(app => app.UseDefaultFiles(new DefaultFilesOptions()
|
||||
{
|
||||
RequestPath = new PathString(baseUrl),
|
||||
FileProvider = fileProvder
|
||||
}));
|
||||
var response = await server.CreateRequest(requestUrl).GetAsync();
|
||||
|
||||
Assert.Equal(HttpStatusCode.NotFound, response.StatusCode); // Passed through
|
||||
Assert.Equal(HttpStatusCode.NotFound, response.StatusCode); // Passed through
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -32,7 +32,7 @@ namespace Microsoft.AspNet.StaticFiles
|
|||
services => services.AddDirectoryBrowser());
|
||||
|
||||
// PathString(null) is OK.
|
||||
TestServer server = StaticFilesTestServer.Create(
|
||||
var server = StaticFilesTestServer.Create(
|
||||
app => app.UseDirectoryBrowser((string)null),
|
||||
services => services.AddDirectoryBrowser());
|
||||
|
||||
|
|
@ -63,15 +63,18 @@ namespace Microsoft.AspNet.StaticFiles
|
|||
|
||||
public async Task NoMatch_PassesThrough(string baseUrl, string baseDir, string requestUrl)
|
||||
{
|
||||
TestServer server = StaticFilesTestServer.Create(
|
||||
app => app.UseDirectoryBrowser(new DirectoryBrowserOptions()
|
||||
{
|
||||
RequestPath = new PathString(baseUrl),
|
||||
FileProvider = new PhysicalFileProvider(Path.Combine(Directory.GetCurrentDirectory(), baseDir))
|
||||
}),
|
||||
services => services.AddDirectoryBrowser());
|
||||
HttpResponseMessage response = await server.CreateRequest(requestUrl).GetAsync();
|
||||
Assert.Equal(HttpStatusCode.NotFound, response.StatusCode);
|
||||
using (var fileProvider = new PhysicalFileProvider(Path.Combine(Directory.GetCurrentDirectory(), baseDir)))
|
||||
{
|
||||
var server = StaticFilesTestServer.Create(
|
||||
app => app.UseDirectoryBrowser(new DirectoryBrowserOptions()
|
||||
{
|
||||
RequestPath = new PathString(baseUrl),
|
||||
FileProvider = fileProvider
|
||||
}),
|
||||
services => services.AddDirectoryBrowser());
|
||||
var response = await server.CreateRequest(requestUrl).GetAsync();
|
||||
Assert.Equal(HttpStatusCode.NotFound, response.StatusCode);
|
||||
}
|
||||
}
|
||||
|
||||
[Theory]
|
||||
|
|
@ -97,19 +100,22 @@ namespace Microsoft.AspNet.StaticFiles
|
|||
|
||||
public async Task FoundDirectory_Served(string baseUrl, string baseDir, string requestUrl)
|
||||
{
|
||||
TestServer server = StaticFilesTestServer.Create(
|
||||
app => app.UseDirectoryBrowser(new DirectoryBrowserOptions()
|
||||
{
|
||||
RequestPath = new PathString(baseUrl),
|
||||
FileProvider = new PhysicalFileProvider(Path.Combine(Directory.GetCurrentDirectory(), baseDir))
|
||||
}),
|
||||
services => services.AddDirectoryBrowser());
|
||||
HttpResponseMessage response = await server.CreateRequest(requestUrl).GetAsync();
|
||||
using (var fileProvider = new PhysicalFileProvider(Path.Combine(Directory.GetCurrentDirectory(), baseDir)))
|
||||
{
|
||||
var server = StaticFilesTestServer.Create(
|
||||
app => app.UseDirectoryBrowser(new DirectoryBrowserOptions()
|
||||
{
|
||||
RequestPath = new PathString(baseUrl),
|
||||
FileProvider = fileProvider
|
||||
}),
|
||||
services => services.AddDirectoryBrowser());
|
||||
var response = await server.CreateRequest(requestUrl).GetAsync();
|
||||
|
||||
Assert.Equal(HttpStatusCode.OK, response.StatusCode);
|
||||
Assert.Equal("text/html; charset=utf-8", response.Content.Headers.ContentType.ToString());
|
||||
Assert.True(response.Content.Headers.ContentLength > 0);
|
||||
Assert.Equal(response.Content.Headers.ContentLength, (await response.Content.ReadAsByteArrayAsync()).Length);
|
||||
Assert.Equal(HttpStatusCode.OK, response.StatusCode);
|
||||
Assert.Equal("text/html; charset=utf-8", response.Content.Headers.ContentType.ToString());
|
||||
Assert.True(response.Content.Headers.ContentLength > 0);
|
||||
Assert.Equal(response.Content.Headers.ContentLength, (await response.Content.ReadAsByteArrayAsync()).Length);
|
||||
}
|
||||
}
|
||||
|
||||
[Theory]
|
||||
|
|
@ -136,19 +142,22 @@ namespace Microsoft.AspNet.StaticFiles
|
|||
|
||||
public async Task NearMatch_RedirectAddSlash(string baseUrl, string baseDir, string requestUrl, string queryString)
|
||||
{
|
||||
TestServer server = StaticFilesTestServer.Create(
|
||||
app => app.UseDirectoryBrowser(new DirectoryBrowserOptions()
|
||||
{
|
||||
RequestPath = new PathString(baseUrl),
|
||||
FileProvider = new PhysicalFileProvider(Path.Combine(Directory.GetCurrentDirectory(), baseDir))
|
||||
}),
|
||||
services => services.AddDirectoryBrowser());
|
||||
using (var fileProvider = new PhysicalFileProvider(Path.Combine(Directory.GetCurrentDirectory(), baseDir)))
|
||||
{
|
||||
var server = StaticFilesTestServer.Create(
|
||||
app => app.UseDirectoryBrowser(new DirectoryBrowserOptions()
|
||||
{
|
||||
RequestPath = new PathString(baseUrl),
|
||||
FileProvider = fileProvider
|
||||
}),
|
||||
services => services.AddDirectoryBrowser());
|
||||
|
||||
HttpResponseMessage response = await server.CreateRequest(requestUrl + queryString).GetAsync();
|
||||
var response = await server.CreateRequest(requestUrl + queryString).GetAsync();
|
||||
|
||||
Assert.Equal(HttpStatusCode.Moved, response.StatusCode);
|
||||
Assert.Equal(requestUrl + "/" + queryString, response.Headers.GetValues("Location").FirstOrDefault());
|
||||
Assert.Equal(0, (await response.Content.ReadAsByteArrayAsync()).Length);
|
||||
Assert.Equal(HttpStatusCode.Moved, response.StatusCode);
|
||||
Assert.Equal(requestUrl + "/" + queryString, response.Headers.GetValues("Location").FirstOrDefault());
|
||||
Assert.Equal(0, (await response.Content.ReadAsByteArrayAsync()).Length);
|
||||
}
|
||||
}
|
||||
|
||||
[Theory]
|
||||
|
|
@ -172,16 +181,19 @@ namespace Microsoft.AspNet.StaticFiles
|
|||
|
||||
public async Task PostDirectory_PassesThrough(string baseUrl, string baseDir, string requestUrl)
|
||||
{
|
||||
TestServer server = StaticFilesTestServer.Create(
|
||||
app => app.UseDirectoryBrowser(new DirectoryBrowserOptions()
|
||||
{
|
||||
RequestPath = new PathString(baseUrl),
|
||||
FileProvider = new PhysicalFileProvider(Path.Combine(Directory.GetCurrentDirectory(), baseDir))
|
||||
}),
|
||||
services => services.AddDirectoryBrowser());
|
||||
using (var fileProvider = new PhysicalFileProvider(Path.Combine(Directory.GetCurrentDirectory(), baseDir)))
|
||||
{
|
||||
var server = StaticFilesTestServer.Create(
|
||||
app => app.UseDirectoryBrowser(new DirectoryBrowserOptions()
|
||||
{
|
||||
RequestPath = new PathString(baseUrl),
|
||||
FileProvider = fileProvider
|
||||
}),
|
||||
services => services.AddDirectoryBrowser());
|
||||
|
||||
HttpResponseMessage response = await server.CreateRequest(requestUrl).PostAsync();
|
||||
Assert.Equal(HttpStatusCode.NotFound, response.StatusCode);
|
||||
var response = await server.CreateRequest(requestUrl).PostAsync();
|
||||
Assert.Equal(HttpStatusCode.NotFound, response.StatusCode);
|
||||
}
|
||||
}
|
||||
|
||||
[Theory]
|
||||
|
|
@ -205,20 +217,23 @@ namespace Microsoft.AspNet.StaticFiles
|
|||
|
||||
public async Task HeadDirectory_HeadersButNotBodyServed(string baseUrl, string baseDir, string requestUrl)
|
||||
{
|
||||
TestServer server = StaticFilesTestServer.Create(
|
||||
app => app.UseDirectoryBrowser(new DirectoryBrowserOptions()
|
||||
{
|
||||
RequestPath = new PathString(baseUrl),
|
||||
FileProvider = new PhysicalFileProvider(Path.Combine(Directory.GetCurrentDirectory(), baseDir))
|
||||
}),
|
||||
services => services.AddDirectoryBrowser());
|
||||
using (var fileProvider = new PhysicalFileProvider(Path.Combine(Directory.GetCurrentDirectory(), baseDir)))
|
||||
{
|
||||
var server = StaticFilesTestServer.Create(
|
||||
app => app.UseDirectoryBrowser(new DirectoryBrowserOptions()
|
||||
{
|
||||
RequestPath = new PathString(baseUrl),
|
||||
FileProvider = fileProvider
|
||||
}),
|
||||
services => services.AddDirectoryBrowser());
|
||||
|
||||
HttpResponseMessage response = await server.CreateRequest(requestUrl).SendAsync("HEAD");
|
||||
var response = await server.CreateRequest(requestUrl).SendAsync("HEAD");
|
||||
|
||||
Assert.Equal(HttpStatusCode.OK, response.StatusCode);
|
||||
Assert.Equal("text/html; charset=utf-8", response.Content.Headers.ContentType.ToString());
|
||||
Assert.True(response.Content.Headers.ContentLength == 0);
|
||||
Assert.Equal(0, (await response.Content.ReadAsByteArrayAsync()).Length);
|
||||
Assert.Equal(HttpStatusCode.OK, response.StatusCode);
|
||||
Assert.Equal("text/html; charset=utf-8", response.Content.Headers.ContentType.ToString());
|
||||
Assert.True(response.Content.Headers.ContentLength == 0);
|
||||
Assert.Equal(0, (await response.Content.ReadAsByteArrayAsync()).Length);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -26,7 +26,7 @@ namespace Microsoft.AspNet.StaticFiles
|
|||
StaticFilesTestServer.Create(app => app.UseStaticFiles(new StaticFileOptions() { FileProvider = null }));
|
||||
|
||||
// PathString(null) is OK.
|
||||
TestServer server = StaticFilesTestServer.Create(app => app.UseStaticFiles((string)null));
|
||||
var server = StaticFilesTestServer.Create(app => app.UseStaticFiles((string)null));
|
||||
var response = await server.CreateClient().GetAsync("/");
|
||||
Assert.Equal(HttpStatusCode.NotFound, response.StatusCode);
|
||||
}
|
||||
|
|
@ -38,13 +38,16 @@ namespace Microsoft.AspNet.StaticFiles
|
|||
[InlineData("", @"./", "/xunit.xml")]
|
||||
public async Task NoMatch_PassesThrough(string baseUrl, string baseDir, string requestUrl)
|
||||
{
|
||||
TestServer server = StaticFilesTestServer.Create(app => app.UseStaticFiles(new StaticFileOptions()
|
||||
using (var fileProvider = new PhysicalFileProvider(Path.Combine(Directory.GetCurrentDirectory(), baseDir)))
|
||||
{
|
||||
RequestPath = new PathString(baseUrl),
|
||||
FileProvider = new PhysicalFileProvider(Path.Combine(Directory.GetCurrentDirectory(), baseDir))
|
||||
}));
|
||||
HttpResponseMessage response = await server.CreateRequest(requestUrl).GetAsync();
|
||||
Assert.Equal(HttpStatusCode.NotFound, response.StatusCode);
|
||||
var server = StaticFilesTestServer.Create(app => app.UseStaticFiles(new StaticFileOptions()
|
||||
{
|
||||
RequestPath = new PathString(baseUrl),
|
||||
FileProvider = fileProvider
|
||||
}));
|
||||
var response = await server.CreateRequest(requestUrl).GetAsync();
|
||||
Assert.Equal(HttpStatusCode.NotFound, response.StatusCode);
|
||||
}
|
||||
}
|
||||
|
||||
[Theory]
|
||||
|
|
@ -72,17 +75,20 @@ namespace Microsoft.AspNet.StaticFiles
|
|||
|
||||
public async Task FoundFile_Served(string baseUrl, string baseDir, string requestUrl)
|
||||
{
|
||||
TestServer server = StaticFilesTestServer.Create(app => app.UseStaticFiles(new StaticFileOptions()
|
||||
using (var fileProvider = new PhysicalFileProvider(Path.Combine(Directory.GetCurrentDirectory(), baseDir)))
|
||||
{
|
||||
RequestPath = new PathString(baseUrl),
|
||||
FileProvider = new PhysicalFileProvider(Path.Combine(Directory.GetCurrentDirectory(), baseDir))
|
||||
}));
|
||||
HttpResponseMessage response = await server.CreateRequest(requestUrl).GetAsync();
|
||||
var server = StaticFilesTestServer.Create(app => app.UseStaticFiles(new StaticFileOptions()
|
||||
{
|
||||
RequestPath = new PathString(baseUrl),
|
||||
FileProvider = fileProvider
|
||||
}));
|
||||
var response = await server.CreateRequest(requestUrl).GetAsync();
|
||||
|
||||
Assert.Equal(HttpStatusCode.OK, response.StatusCode);
|
||||
Assert.Equal("text/plain", response.Content.Headers.ContentType.ToString());
|
||||
Assert.True(response.Content.Headers.ContentLength > 0);
|
||||
Assert.Equal(response.Content.Headers.ContentLength, (await response.Content.ReadAsByteArrayAsync()).Length);
|
||||
Assert.Equal(HttpStatusCode.OK, response.StatusCode);
|
||||
Assert.Equal("text/plain", response.Content.Headers.ContentType.ToString());
|
||||
Assert.True(response.Content.Headers.ContentLength > 0);
|
||||
Assert.Equal(response.Content.Headers.ContentLength, (await response.Content.ReadAsByteArrayAsync()).Length);
|
||||
}
|
||||
}
|
||||
|
||||
[Theory]
|
||||
|
|
@ -93,13 +99,16 @@ namespace Microsoft.AspNet.StaticFiles
|
|||
[InlineData("/somedir", @"SubFolder", "/somedir/ranges.txt")]
|
||||
public async Task PostFile_PassesThrough(string baseUrl, string baseDir, string requestUrl)
|
||||
{
|
||||
TestServer server = StaticFilesTestServer.Create(app => app.UseStaticFiles(new StaticFileOptions()
|
||||
using (var fileProvider = new PhysicalFileProvider(Path.Combine(Directory.GetCurrentDirectory(), baseDir)))
|
||||
{
|
||||
RequestPath = new PathString(baseUrl),
|
||||
FileProvider = new PhysicalFileProvider(Path.Combine(Directory.GetCurrentDirectory(), baseDir))
|
||||
}));
|
||||
HttpResponseMessage response = await server.CreateRequest(requestUrl).PostAsync();
|
||||
Assert.Equal(HttpStatusCode.NotFound, response.StatusCode);
|
||||
var server = StaticFilesTestServer.Create(app => app.UseStaticFiles(new StaticFileOptions()
|
||||
{
|
||||
RequestPath = new PathString(baseUrl),
|
||||
FileProvider = fileProvider
|
||||
}));
|
||||
var response = await server.CreateRequest(requestUrl).PostAsync();
|
||||
Assert.Equal(HttpStatusCode.NotFound, response.StatusCode);
|
||||
}
|
||||
}
|
||||
|
||||
[Theory]
|
||||
|
|
@ -110,17 +119,20 @@ namespace Microsoft.AspNet.StaticFiles
|
|||
[InlineData("/somedir", @"SubFolder", "/somedir/ranges.txt")]
|
||||
public async Task HeadFile_HeadersButNotBodyServed(string baseUrl, string baseDir, string requestUrl)
|
||||
{
|
||||
TestServer server = StaticFilesTestServer.Create(app => app.UseStaticFiles(new StaticFileOptions()
|
||||
using (var fileProvider = new PhysicalFileProvider(Path.Combine(Directory.GetCurrentDirectory(), baseDir)))
|
||||
{
|
||||
RequestPath = new PathString(baseUrl),
|
||||
FileProvider = new PhysicalFileProvider(Path.Combine(Directory.GetCurrentDirectory(), baseDir))
|
||||
}));
|
||||
HttpResponseMessage response = await server.CreateRequest(requestUrl).SendAsync("HEAD");
|
||||
var server = StaticFilesTestServer.Create(app => app.UseStaticFiles(new StaticFileOptions()
|
||||
{
|
||||
RequestPath = new PathString(baseUrl),
|
||||
FileProvider = fileProvider
|
||||
}));
|
||||
var response = await server.CreateRequest(requestUrl).SendAsync("HEAD");
|
||||
|
||||
Assert.Equal(HttpStatusCode.OK, response.StatusCode);
|
||||
Assert.Equal("text/plain", response.Content.Headers.ContentType.ToString());
|
||||
Assert.True(response.Content.Headers.ContentLength > 0);
|
||||
Assert.Equal(0, (await response.Content.ReadAsByteArrayAsync()).Length);
|
||||
Assert.Equal(HttpStatusCode.OK, response.StatusCode);
|
||||
Assert.Equal("text/plain", response.Content.Headers.ContentType.ToString());
|
||||
Assert.True(response.Content.Headers.ContentLength > 0);
|
||||
Assert.Equal(0, (await response.Content.ReadAsByteArrayAsync()).Length);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue