public void GetFileStart() { var context = CreateContext(); string path = PathMapping.Map(TestFilePath); context.SendFile(path, 0, 20) .Wait(); context.Response.Body.Position = 0; context.Response.Body.ReadAll() .ShouldEqual("This is a test. This"); context.Response.Headers.ContentLength.ShouldEqual(20); }
public void GetFileEndWithOverRequest() { var context = CreateContext(); string path = PathMapping.Map(TestFilePath); context.SendFile(path, 10, 400) .Wait(); context.Response.Body.Position = 0; context.Response.Body.ReadAll() .ShouldEqual("test. This is simply a test. (Save with ASCII codepage)"); context.Response.Headers.ContentLength.ShouldEqual(55); }