8000 Fix undisposed stream in test · apfunk/libgit2sharp@6b6a44a · GitHub
[go: up one dir, main page]

Skip to content

Commit 6b6a44a

Browse files
dahlbyknulltoken
authored andcommitted
Fix undisposed stream in test
1 parent bedccca commit 6b6a44a

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

LibGit2Sharp.Tests/BlobFixture.cs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,11 @@ public void CanGetBlobAsTextWithVariousEncodings(string encodingName, int expect
6767
var commit = repo.Commit("bom", Constants.Signature, Constants.Signature);
6868

6969
var blob = (Blob)commit.Tree[bomFile].Target;
70-
Assert.Equal(expectedContentBytes, blob.GetContentStream().Length);
70+
Assert.Equal(expectedContentBytes, blob.Size);
71+
using (var stream = blob.GetContentStream())
72+
{
73+
Assert.Equal(expectedContentBytes, stream.Length);
74+
}
7175

7276
var textDetected = blob.GetContentText();
7377
Assert.Equal(content, textDetected);

0 commit comments

Comments
 (0)
0