public void Can_restore() { MemDbProvider provider = new MemDbProvider(NullLogManager.Instance); provider.GetOrCreateCodeDb(); provider.GetOrCreateStateDb(); for (int i = 0; i < 1000; i++) { int snapshot = provider.TakeSnapshot(); provider.Restore(snapshot); } Assert.AreEqual(0, provider.Snapshots.Count); }
public void Does_not_keep_unnecessary_snapshots() { MemDbProvider provider = new MemDbProvider(NullLogManager.Instance); provider.GetOrCreateCodeDb(); provider.GetOrCreateStateDb(); for (int i = 0; i < 1000; i++) { provider.TakeSnapshot(); provider.Commit(Olympic.Instance); } Assert.AreEqual(0, provider.Snapshots.Count); }