20 using NUnit.Framework;
22 namespace Deveel.Data.Store {
28 private const string DatabaseName =
"test_db";
29 private const string TestAdminUser =
"SA";
30 private const string TestAdminPass =
"abc1234";
34 dbConfig.SetValue(
"database.name", DatabaseName);
36 dbConfig.SetValue(
"database.basePath", Environment.CurrentDirectory);
41 var localPath = Environment.CurrentDirectory;
42 var fileName = String.Format(
"{0}.db", DatabaseName);
43 return Path.Combine(localPath, fileName);
48 systemContext = systemBuilder.BuildSystem();
50 var dbConfig = CreateDatabaseConfig();
52 if (testName !=
"CreateNewDatabase") {
53 database = systemContext.
CreateDatabase(dbConfig, TestAdminUser, TestAdminPass);
59 var test = TestContext.CurrentContext.Test;
66 if (database != null) {
71 var fileName = GetDbFileName();
72 if (
File.Exists(fileName))
73 File.Delete(fileName);
78 var dbConfig = CreateDatabaseConfig();
79 database = systemContext.
CreateDatabase(dbConfig, TestAdminUser, TestAdminPass);
void OnSetUp(string testName)
void Close()
Closes the database making it not accessible to connections.
IDatabase CreateDatabase(IConfiguration configuration, string adminUser, string adminPassword)
static IConfiguration CreateDatabaseConfig()
The representation of a single database in the system.
Defines the contract for the configuration node of a component within the system or of the system its...
static string GetDbFileName()
Configuration(bool isRoot)
Constructs the Configuration.