public async Task Can_seek_from_beginning_to_end()
{
var mockRequest = new MockHttpRequest();
var mockResponse = new MockHttpResponse(mockRequest);
mockRequest.Headers[HttpHeaders.Range] = "bytes=0";
string customText = "1234567890";
byte[] customTextBytes = customText.ToUtf8Bytes();
var ms = new MemoryStream();
ms.Write(customTextBytes, 0, customTextBytes.Length);
var httpResult = new HttpResult(ms, "audio/mpeg");
bool reponseWasAutoHandled = await mockResponse.WriteToResponse(mockRequest, httpResult);
Assert.That(reponseWasAutoHandled, Is.True);
string writtenString = mockResponse.ReadAsString();
Assert.That(writtenString, Is.EqualTo(customText));
Assert.That(mockResponse.Headers["Content-Range"], Is.EqualTo("bytes 0-9/10"));
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));
}