Skip to content

Commit

Permalink
Found bug in MemoryStore
Browse files Browse the repository at this point in the history
  • Loading branch information
shargon committed Feb 10, 2024
1 parent 95708b5 commit 561a8dc
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions tests/Neo.UnitTests/Persistence/UT_MemoryStore.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,21 @@ namespace Neo.UnitTests.Persistence
[TestClass]
public class UT_MemoryStore
{
[TestMethod]
public void SnapshotTest()
{
using var store = new MemoryStore();

store.Put(new byte[] { 1 }, new byte[] { 1, 2, 3 });

var snapshot = store.GetSnapshot();

snapshot.Put(new byte[] { 1 }, new byte[] { 1, 2, 3, 4 });

CollectionAssert.AreEqual(new byte[] { 1, 2, 3 }, store.TryGet(new byte[] { 1 }));
CollectionAssert.AreEqual(new byte[] { 1, 2, 3, 4 }, snapshot.TryGet(new byte[] { 1 }));
}

[TestMethod]
public void StoreTest()
{
Expand Down

0 comments on commit 561a8dc

Please sign in to comment.