public void SetupFixture() { ClassDef.ClassDefs.Clear(); ClassDef.ClassDefs.Add(new XmlClassDefsLoader(BOBroker.GetClassDefsXml(), new DtdLoader(), new DefClassFactory()).LoadClassDefs()); BORegistry.DataAccessor = new DataAccessorInMemory(); GlobalUIRegistry.ControlFactory = CreateNewControlFactory(); }
protected void Application_Start() { AreaRegistration.RegisterAllAreas(); FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters); RouteConfig.RegisterRoutes(RouteTable.Routes); BundleConfig.RegisterBundles(BundleTable.Bundles); IocContainer.Setup(); GlobalRegistry.ApplicationName = "TestHabanero"; GlobalRegistry.ApplicationVersion = "1.32.05 - 2016.03.08"; var testHabaneroApp = new HabaneroAppConsole(GlobalRegistry.ApplicationName, GlobalRegistry.ApplicationVersion); testHabaneroApp.LoadClassDefs = false; var databaseConfig = DatabaseConfig.ReadFromConfigFile(); // if (GetCurrentVerison() < 102) // { // GlobalRegistry.Settings = new DatabaseSettings("settings", DatabaseConnection.CurrentConnection); // var scriptPath = Server.MapPath("~") + "\\Content\\Scripts"; // DatabaseMigrator.ProcessMigrateCommand(scriptPath); // } DatabaseConnection.CurrentConnection = databaseConfig.GetDatabaseConnection(); BORegistry.DataAccessor = new DataAccessorDB(); BOBroker.LoadClassDefs(); var connectionString = GetConnectionString(); MigrateDatabaseWith(connectionString); }
public void SetupFixture() { ClassDef.ClassDefs.Clear(); ClassDef.ClassDefs.Add(new XmlClassDefsLoader(BOBroker.GetClassDefsXml(), new DtdLoader(), new DefClassFactory()).LoadClassDefs()); BORegistry.DataAccessor = new DataAccessorInMemory(); GlobalUIRegistry.ControlFactory = GetControlFactory(); GlobalRegistry.UIExceptionNotifier = new RethrowingExceptionNotifier(); }
public void Test_NewParentWithClassTableInheritance_NewChild() { //---------------Set up test pack------------------- ClassDef.ClassDefs.Clear(); ClassDef.ClassDefs.Add(new XmlClassDefsLoader(BOBroker.GetClassDefsXml(), new DtdLoader(), new DefClassFactory()).LoadClassDefs()); Habanero.Test.Structure.Person person = new Person(); person.LastName = "bob"; Vehicle vehicle = new Vehicle(); vehicle.DateAssembled = DateTime.Now; person.VehiclesOwned.Add(vehicle); //---------------Assert Precondition---------------- //---------------Execute Test ---------------------- TransactionCommitter committer = (TransactionCommitter)BORegistry.DataAccessor.CreateTransactionCommitter(); committer.AddBusinessObject(person); committer.CommitTransaction(); //---------------Test Result ----------------------- Assert.AreEqual(2, committer.OriginalTransactions.Count, "There should only be two transactions: one insert for the person and one insert for the vehicle"); }
public void SetupFixture() { ClassDef.ClassDefs.Clear(); ClassDef.ClassDefs.Add(new XmlClassDefsLoader(BOBroker.GetClassDefsXml(), new DtdLoader(), new DefClassFactory()).LoadClassDefs()); }
private BOTestFactory <T> CreateFactory <T>() where T : BusinessObject { BOBroker.LoadClassDefs(); return(new BOTestFactory <T>()); }
public static void SetupFixture() { BOBroker.LoadClassDefs(); }