public async Task Can_use_fileStream()
{
byte[] fileBytes = uploadedTextFile.ReadFully();
string fileText = Encoding.ASCII.GetString(fileBytes);
"File content size {0}".Print(fileBytes.Length);
"File content is {0}".Print(fileText);
var mockRequest = new MockHttpRequest();
var mockResponse = new MockHttpResponse(mockRequest);
mockRequest.Headers.Add("Range", "bytes=6-8");
var httpResult = new HttpResult(uploadedTextFile, "audio/mpeg");
bool reponseWasAutoHandled = await mockResponse.WriteToResponse(mockRequest, httpResult);
Assert.That(reponseWasAutoHandled, Is.True);
string writtenString = mockResponse.ReadAsString();
Assert.That(writtenString, Is.EqualTo(fileText.Substring(6, 3)));
Assert.That(mockResponse.Headers["Content-Range"], Is.EqualTo("bytes 6-8/33"));
Assert.That(mockResponse.Headers["Content-Length"], Is.EqualTo(writtenString.Length.ToString()));
Assert.That(mockResponse.Headers["Accept-Ranges"], Is.EqualTo("bytes"));
Assert.That(mockResponse.StatusCode, Is.EqualTo(206));
}