@@ -123,7 +123,7 @@ public async Task FlattenPdf_Succeeds()
123123 var builder = PdfEngineBuilders . Flatten ( )
124124 . WithPdfs ( a => a . AddItem ( "test.pdf" , pdfBytes ) ) ;
125125
126- var result = await client . ExecutePdfEngineAsync ( builder ) ;
126+ using var result = await client . ExecutePdfEngineAsync ( builder ) ;
127127
128128 result . Should ( ) . NotBeNull ( ) ;
129129 result . Length . Should ( ) . BeGreaterThan ( 0 ) ;
@@ -139,7 +139,7 @@ public async Task RotatePdf_Succeeds()
139139 var builder = PdfEngineBuilders . Rotate ( 90 )
140140 . WithPdfs ( a => a . AddItem ( "test.pdf" , pdfBytes ) ) ;
141141
142- var result = await client . ExecutePdfEngineAsync ( builder ) ;
142+ using var result = await client . ExecutePdfEngineAsync ( builder ) ;
143143
144144 result . Should ( ) . NotBeNull ( ) ;
145145 result . Length . Should ( ) . BeGreaterThan ( 0 ) ;
@@ -155,7 +155,7 @@ public async Task EncryptPdf_Succeeds()
155155 var builder = PdfEngineBuilders . Encrypt ( "user123" , "owner456" )
156156 . WithPdfs ( a => a . AddItem ( "test.pdf" , pdfBytes ) ) ;
157157
158- var result = await client . ExecutePdfEngineAsync ( builder ) ;
158+ using var result = await client . ExecutePdfEngineAsync ( builder ) ;
159159
160160 result . Should ( ) . NotBeNull ( ) ;
161161 result . Length . Should ( ) . BeGreaterThan ( 0 ) ;
@@ -175,7 +175,7 @@ public async Task WriteMetadata_Succeeds()
175175 } )
176176 . WithPdfs ( a => a . AddItem ( "test.pdf" , pdfBytes ) ) ;
177177
178- var result = await client . ExecutePdfEngineAsync ( builder ) ;
178+ using var result = await client . ExecutePdfEngineAsync ( builder ) ;
179179
180180 result . Should ( ) . NotBeNull ( ) ;
181181 result . Length . Should ( ) . BeGreaterThan ( 0 ) ;
@@ -220,7 +220,7 @@ private static async Task<byte[]> GenerateTestPdf(Gotenberg.Sharp.API.Client.Got
220220 var builder = new HtmlRequestBuilder ( )
221221 . AddDocument ( doc => doc . SetBody ( "<html><body><h1>Test PDF</h1></body></html>" ) ) ;
222222
223- var stream = await client . HtmlToPdfAsync ( builder ) ;
223+ using var stream = await client . HtmlToPdfAsync ( builder ) ;
224224
225225 using var ms = new MemoryStream ( ) ;
226226 await stream . CopyToAsync ( ms ) ;
0 commit comments