public void Can_Save_To_Repository() { DatabaseSchema databaseSchema = new DatabaseSchema(); databaseSchema.Name = "TestDB"; databaseSchema.Version = new DatabaseVersion(0,0,0,1); var schemaMetadata = new DatabaseUtility.Metadata.SchemaMetadata(); databaseSchema.StoredProcedures = schemaMetadata.GetStoredProcedures(); var repository = new DatabaseUtility.Schema.Repository.XmlDatabaseSchemaRepository(); repository.RepositoryLocation = @"C:\Test\DatabaseSchemaRepository.xml"; repository.SaveDatabaseSchema(databaseSchema); }
public void Can_Save_To_Repository() { DatabaseSchema databaseSchema = new DatabaseSchema(); databaseSchema.Name = "TestDB"; databaseSchema.Version = new DatabaseVersion(0, 0, 0, 1); var schemaMetadata = new DatabaseUtility.Metadata.SchemaMetadata(); databaseSchema.StoredProcedures = schemaMetadata.GetStoredProcedures(); var repository = new DatabaseUtility.Schema.Repository.DbDatabaseSchemaRepository(); repository.RepositoryLocation = System.Configuration.ConfigurationManager.ConnectionStrings["DbRepository"].ConnectionString; repository.SaveDatabaseSchema(databaseSchema); }
public void Can_Save_To_Repository() { DatabaseSchema databaseSchema = new DatabaseSchema(); databaseSchema.Name = "Compass"; databaseSchema.Version = new DatabaseVersion(0,0,0,1); var schemaMetadata = new DatabaseUtility.Metadata.SchemaMetadata(); databaseSchema.StoredProcedures = schemaMetadata.GetStoredProcedures(new System.String[] { "p_AppointmentType_Select", "p_AppointmentType_Insert", "p_AppointmentType_Update" }); var repository = new DatabaseUtility.Schema.Repository.DirectoryDatabaseSchemaRepository(); repository.RepositoryLocation = @"C:\Test\DatabaseSchemaRepository"; repository.SaveDatabaseSchema(databaseSchema); }
public void Saved_DatabaseSchema_Equivalent_To_Loaded() { DatabaseSchema original = new DatabaseSchema(); original.Name = "TestDB"; original.Version = new DatabaseVersion(0, 0, 0, 1); var schemaMetadata = new DatabaseUtility.Metadata.SchemaMetadata(); original.StoredProcedures = schemaMetadata.GetStoredProcedures(); var saveRepository = new DatabaseUtility.Schema.Repository.XmlDatabaseSchemaRepository(); saveRepository.RepositoryLocation = @"C:\Test\DatabaseSchemaRepository.xml"; saveRepository.SaveDatabaseSchema(original); var loadRepository = new DatabaseUtility.Schema.Repository.XmlDatabaseSchemaRepository(); loadRepository.RepositoryLocation = @"C:\Test\DatabaseSchemaRepository.xml"; var loaded = loadRepository.LoadDatabaseSchema("TestDB", new DatabaseVersion(0, 0, 0, 1)); DatabaseSchemaAssertions.DatabaseSchemasAreEquivalent(original, loaded); }
public void Saved_DatabaseSchema_Equivalent_To_Loaded() { DatabaseSchema original = new DatabaseSchema(); original.Name = "TestDB"; original.Version = new DatabaseVersion(0, 0, 0, 1); var schemaMetadata = new DatabaseUtility.Metadata.SchemaMetadata(); original.StoredProcedures = schemaMetadata.GetStoredProcedures(); var saveRepository = new DatabaseUtility.Schema.Repository.DbDatabaseSchemaRepository(); saveRepository.RepositoryLocation = System.Configuration.ConfigurationManager.ConnectionStrings["DbRepository"].ConnectionString; saveRepository.SaveDatabaseSchema(original); var loadRepository = new DatabaseUtility.Schema.Repository.DbDatabaseSchemaRepository(); loadRepository.RepositoryLocation = System.Configuration.ConfigurationManager.ConnectionStrings["DbRepository"].ConnectionString; var loaded = loadRepository.LoadDatabaseSchema("TestDB", new DatabaseVersion(0, 0, 0, 1)); DatabaseSchemaAssertions.DatabaseSchemasAreEquivalent(original, loaded); }
public abstract void SaveDatabaseSchema(DatabaseSchema databaseSchema);