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();
                }
            }
        }
Ejemplo n.º 2
0
 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);
         }
     }
 }
Ejemplo n.º 3
0
 public void Setup()
 {
     this.fileSystem = MultiContainerMemoryDB.Create();
     this.db         = fileSystem.NewDB(ConfigureDb);
     FixtureSetup(db);
 }