예제 #1
0
        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);
        }
예제 #2
0
        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);
        }