public void TestTextFile() { //MyStream is not working. _request.Uri = new Uri("http://localhost/files/HttpModules/TextFile1.txt"); _module.Process(_request, _response, new MemorySession("name")); _context.Stream.Seek(0, SeekOrigin.Begin); TextReader reader = new StreamReader(_context.Stream); string text = reader.ReadToEnd(); int pos = text.IndexOf("\r\n\r\n"); Assert.True(pos >= 0); text = text.Substring(pos + 4); Assert.Equal("Hello World!", text); }