Chunk writes to file in tests (#759)

This commit is contained in:
Justin Kotalik 2018-04-04 14:24:43 -07:00 committed by GitHub
parent ce9ffaddad
commit 9f530d6621
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 9 additions and 1 deletions

View File

@ -652,7 +652,15 @@ namespace IISTestSite
app.Run(async ctx =>
{
var tempFile = Path.GetTempFileName();
File.WriteAllText(tempFile, new string('a', 200000000));
var fileContent = new string('a', 200000);
var fileStream = File.OpenWrite(tempFile);
for (var i = 0; i < 1000; i++)
{
await fileStream.WriteAsync(Encoding.UTF8.GetBytes(fileContent), 0, fileContent.Length);
}
fileStream.Close();
await ctx.Response.SendFileAsync(tempFile, 0, null);
// Try to delete the file from the temp directory. If it fails, don't report an error