/// <exception cref="System.Exception"></exception>
        public virtual void Test()
        {
            Db4oLibraryEnvironment originalEnv = EnvironmentForVersion("6.0");

            originalEnv.InvokeInstanceMethod(typeof(MigrationHopsTestCase.Tester), "createDatabase"
                                             , new object[] { TempFile() });
            string[] hopArray = new string[] { "6.4", "7.4", CurrentVersion() };
            for (int hopIndex = 0; hopIndex < hopArray.Length; ++hopIndex)
            {
                string hop = hopArray[hopIndex];
                Db4oLibraryEnvironment hopEnvironment = EnvironmentForVersion(hop);
                Assert.AreEqual(originalEnv.Version(), InvokeTesterMethodOn(hopEnvironment, "currentVersion"
                                                                            ));
            }
            IEmbeddedConfiguration config = Db4oEmbedded.NewConfiguration();

            config.Common.ReflectWith(new ExcludingReflector(new Type[] { typeof(MigrationHopsTestCase.Item
                                                                                 ) }));
            IEmbeddedObjectContainer container = Db4oEmbedded.OpenFile(config, TempFile());

            try
            {
                IQuery query = container.Query();
                query.Constrain(typeof(MigrationHopsTestCase.Item));
                object item = query.Execute()[0];
                Assert.AreEqual(originalEnv.Version(), ((GenericObject)item).Get(0));
            }
            finally
            {
                container.Close();
            }
        }
 /// <exception cref="System.Exception"></exception>
 private object InvokeTesterMethodOn(Db4oLibraryEnvironment env74, string methodName
                                     )
 {
     return(env74.InvokeInstanceMethod(typeof(MigrationHopsTestCase.Tester), methodName
                                       , new object[] { TempFile() }));
 }
Beispiel #3
0
 /// <exception cref="System.Exception"></exception>
 private object InvokeTesterMethodOn(Db4oLibraryEnvironment env74, string methodName
                                     )
 {
     return(env74.InvokeInstanceMethod(typeof(Tester), methodName, TempFile()));
 }