public async Task FakeRazorWithHeapStringsInMemory() { var albums = DataGenerator.GetHeapAlbums(); var razorPage = new AlbumFakeRazorPage_Heap(albums, false); using (var memoryStream = new MemoryStream()) using (var streamWriter = new StreamWriter(memoryStream)) { await razorPage.ExecuteAsync(streamWriter); await memoryStream.FlushAsync(); } }
public async Task FakeRazorWithHeapStringsInFileAsync() { var albums = DataGenerator.GetHeapAlbums(); var razorPage = new AlbumFakeRazorPage_Heap(albums, true); using (var fileStream = new FileStream(Path.Combine(directory, Guid.NewGuid().ToString()), FileMode.CreateNew)) using (var streamWriter = new StreamWriter(fileStream)) { await razorPage.ExecuteAsync(streamWriter); await streamWriter.FlushAsync(); await fileStream.FlushAsync(); } }