public override async Task OpenWriteAsync_WithIntermediateFlushes() { // Arrange await using IDisposingContainer <BlobContainerClient> disposingContainer = await GetDisposingContainerAsync(); PageBlobClient client = GetResourceClient(disposingContainer.Container); // Act using (Stream stream = await OpenWriteAsync(client, overwrite: true, maxDataSize: 2 * Constants.KB, bufferSize: 2 * Constants.KB)) { using (var writer = new StreamWriter(stream, Encoding.ASCII)) { writer.Write(new string('A', 512)); writer.Flush(); writer.Write(new string('B', 1024)); writer.Flush(); writer.Write(new string('C', 512)); writer.Flush(); } } // Assert byte[] dataResult = (await DownloadAsync(client)).ToArray(); Assert.AreEqual(new string('A', 512) + new string('B', 1024) + new string('C', 512), Encoding.ASCII.GetString(dataResult)); await(AdditionalAssertions?.Invoke(client) ?? Task.CompletedTask); }