public void DbVerion_Test() { var m = new MemoryStream(); using (var db = new VerDatabase(m, 1)) { Assert.AreEqual(true, db.CollectionExists("col1")); Assert.AreEqual(false, db.CollectionExists("col2")); Assert.AreEqual(false, db.CollectionExists("col3")); } using (var db = new VerDatabase(m, 2)) { Assert.AreEqual(true, db.CollectionExists("col1")); Assert.AreEqual(true, db.CollectionExists("col2")); Assert.AreEqual(false, db.CollectionExists("col3")); } using (var db = new VerDatabase(m, 3)) { Assert.AreEqual(true, db.CollectionExists("col1")); Assert.AreEqual(true, db.CollectionExists("col2")); Assert.AreEqual(true, db.CollectionExists("col3")); } }
public void DbVerion_Test() { var m = new MemoryStream(); using (var db = new VerDatabase(m)) { Assert.AreEqual(true, db.CollectionExists("col1")); Assert.AreEqual(false, db.CollectionExists("col2")); Assert.AreEqual(false, db.CollectionExists("col3")); } VerDatabase.STEP = 2; // to simulate changes in time using (var db = new VerDatabase(m)) { Assert.AreEqual(true, db.CollectionExists("col1")); Assert.AreEqual(true, db.CollectionExists("col2")); Assert.AreEqual(false, db.CollectionExists("col3")); } VerDatabase.STEP = 3; // to simulate changes in time using (var db = new VerDatabase(m)) { Assert.AreEqual(true, db.CollectionExists("col1")); Assert.AreEqual(true, db.CollectionExists("col2")); Assert.AreEqual(true, db.CollectionExists("col3")); } }