public void write_file() { new FileSystem().WriteStringToFile("text.txt", "some text"); theRecordedOutput.WriteFile("text/plain", "text.txt", "This is cool"); theRecordedOutput.Replay(theHttpResponse); theHttpResponse.AssertWasCalled(x => x.WriteContentType("text/plain")); theHttpResponse.AssertWasCalled(x => x.AppendHeader(HttpResponseHeaders.ContentDisposition, "attachment; filename=\"This is cool\"")); theHttpResponse.AssertWasCalled(x => x.AppendHeader(HttpResponseHeaders.ContentLength, "9")); theHttpResponse.AssertWasCalled(x => x.WriteFile("text.txt")); }