diff options
author | Edward Thomson <ethomson@edwardthomson.com> | 2017-11-24 17:45:45 +0300 |
---|---|---|
committer | Edward Thomson <ethomson@edwardthomson.com> | 2017-11-25 19:36:21 +0300 |
commit | 923bd8348be48307582cca1d0953038363d9f274 (patch) | |
tree | 833192b025ea21a6c90e0aca6c4cbd5a4f11235c | |
parent | 0cdc81a9c87bc87f791c2bb3156aebac020c1c3d (diff) |
ObjectDatabase: test `Write`ing a blob
Test that we can `ObjectDatabase.Write` a blob.
-rw-r--r-- | LibGit2Sharp.Tests/ObjectDatabaseFixture.cs | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/LibGit2Sharp.Tests/ObjectDatabaseFixture.cs b/LibGit2Sharp.Tests/ObjectDatabaseFixture.cs index 76773248..7cb79d92 100644 --- a/LibGit2Sharp.Tests/ObjectDatabaseFixture.cs +++ b/LibGit2Sharp.Tests/ObjectDatabaseFixture.cs @@ -121,6 +121,18 @@ namespace LibGit2Sharp.Tests } } + [Fact] + public void CanWriteABlobFromAByteArray() + { + var ba = Encoding.ASCII.GetBytes("libgit2\r\n"); + + using (var repo = new Repository(InitNewRepository())) + { + var id = repo.ObjectDatabase.Write<Blob>(ba); + Assert.Equal(new ObjectId("99115ea359379a218c47cffc83cd0af8c91c4061"), id); + } + } + Stream PrepareMemoryStream(int contentSize) { var sb = new StringBuilder(); |