public void CanDealWithGenerics() { var containerStorage = MultiContainerMemoryDB.Create(); using (var container = containerStorage.NewDB()) { container.Store(new WithGenericDictionary()); } using (var container = containerStorage.NewDB(c => { c.File.ReadOnly = true; })) { var ctx = DatabaseContext.Create(container, TestUtils.NewName(), TypeLoader.Create(new string[0])); CurrentContext.NewContext(ctx); try { var queryContext = (IQueryable <WithGenericDictionary>)ctx.MetaInfo.DataContext. GetProperty("ExampleDatabasesWithKnownTypesTests_WithGenericDictionary").GetValue(null, null); Assert.AreEqual(1, queryContext.Count()); } finally { CurrentContext.CloseContext(); } } }
public void Setup() { originalData = new List <Person>() { new Person("Roman", "Stoffel", 42), new Person("Roman", "Stoffel", 33), new Person("Tom", "Cool", 33) }; this.testDBs = MultiContainerMemoryDB.Create(); using (var db = testDBs.NewDB()) { foreach (var person in originalData) { db.Store(person); } } }
public void Setup() { originalData = new List<Person>() { new Person("Roman","Stoffel",42), new Person("Roman","Stoffel",33), new Person("Tom","Cool",33) }; this.testDBs = MultiContainerMemoryDB.Create(); using(var db = testDBs.NewDB()) { foreach (var person in originalData) { db.Store(person); } } }
public void Setup() { this.fileSystem = MultiContainerMemoryDB.Create(); this.db = fileSystem.NewDB(ConfigureDb); FixtureSetup(db); }