public void AppendKey() { var updateStrategy = new AppendKey <string, string>(); using (var blocks = CreateBlocks(true)) { var gist = CreateGist(blocks, updateStrategy); gist.Insert("A", "value for A"); blocks.AutoCommit = true; } using (var blocks = CreateBlocks(true)) { var gist = CreateGist(blocks, updateStrategy); gist.Insert("A", "second value for A"); blocks.AutoCommit = true; } using (var blocks = CreateBlocks(false)) { var gist = CreateGist(blocks, updateStrategy); CollectionAssert.AreEqual(new[] { "A", "A" }, gist.Scan().Select(kv => kv.Key).ToArray()); CollectionAssert.AreEqual(new[] { "second value for A", "value for A" }, gist.Scan().Select(kv => kv.Value).OrderBy(v => v).ToArray()); } }
static UpdateStrategy() { UniqueKey = new UniqueKey <TKey, TValue>(); UpdateKey = new UpdateKey <TKey, TValue>(); AppendKey = new AppendKey <TKey, TValue>(); }