aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/Tango.UnitTesting
diff options
context:
space:
mode:
Diffstat (limited to 'Software/Visual_Studio/Tango.UnitTesting')
-rw-r--r--Software/Visual_Studio/Tango.UnitTesting/SQLExaminer_TST.cs56
1 files changed, 47 insertions, 9 deletions
diff --git a/Software/Visual_Studio/Tango.UnitTesting/SQLExaminer_TST.cs b/Software/Visual_Studio/Tango.UnitTesting/SQLExaminer_TST.cs
index 84a81035b..32cd3eedb 100644
--- a/Software/Visual_Studio/Tango.UnitTesting/SQLExaminer_TST.cs
+++ b/Software/Visual_Studio/Tango.UnitTesting/SQLExaminer_TST.cs
@@ -82,23 +82,24 @@ namespace Tango.UnitTesting
}
[TestMethod]
+ public void LoadReport()
+ {
+ ExaminerDataReport report = ExaminerDataReport.FromFile("C:\\DATA\\report_data.xml");
+ }
+
+ [TestMethod]
public void Synchronize_Schema()
{
SqlConnection connection = new SqlConnection("Server=localhost\\SQLEXPRESS;Integrated security=SSPI");
- String command = @"CREATE DATABASE Test";
-
- SqlCommand cmd = new SqlCommand(command, connection);
- connection.Open();
- cmd.ExecuteNonQuery();
-
ExaminerConfigurationBuilder builder = new ExaminerConfigurationBuilder(ExaminerConfigurationType.Schema);
var temp_folder = Helper.GetTempFolderPath();
builder.
SetSourceServer("localhost\\SQLEXPRESS", "Tango").
- SetTargetServer("localhost\\SQLEXPRESS", "Test");
+ SetTargetServer("localhost\\SQLEXPRESS", "Test").
+ SetReportFile("C:\\Data\\Report.xml");
var config = builder.Build();
@@ -121,7 +122,8 @@ namespace Tango.UnitTesting
builder.
SetSourceServer("localhost\\SQLEXPRESS", "Tango").
- SetTargetServer("localhost\\SQLEXPRESS", "Test");
+ SetTargetServer("localhost\\SQLEXPRESS", "Test").
+ SetReportFile("C:\\DATA\\report_data.xml");
var config = builder.Build();
@@ -130,7 +132,7 @@ namespace Tango.UnitTesting
config.ToFile(config_path);
ExaminerProcess process = new ExaminerProcess(config_path, ExaminerProcessType.Data);
- process.Progress += (x, msg) =>
+ process.Progress += (x, msg) =>
{
Debug.WriteLine(msg);
};
@@ -166,5 +168,41 @@ namespace Tango.UnitTesting
Assert.AreEqual(result.ExitCode, ExaminerProcessExitCode.Success);
}
+
+ [TestMethod]
+ public void Perform_Full_DataBase_Cycle()
+ {
+ String temp_folder = Helper.GetTempFolderPath();
+
+ String tango_db = "Tango";
+ String source_db = "Source_DB_Test";
+ String target_db = "Target_DB_Test";
+
+ DbManager db = new DbManager(new SqlConnection("Server=localhost\\SQLEXPRESS;Integrated security=SSPI"));
+ Assert.IsTrue(db.Exists("Tango"), "Database Tango does not exists.");
+
+ Assert.IsFalse(db.Exists(source_db), source_db + " already exists.");
+ Assert.IsFalse(db.Exists(target_db), target_db + " already exists.");
+
+ db.Create(source_db);
+ db.Create(target_db);
+
+ ExaminerConfigurationBuilder builder = new ExaminerConfigurationBuilder(ExaminerConfigurationType.Schema);
+
+ builder.
+ SetSourceServer("localhost\\SQLEXPRESS", tango_db).
+ SetTargetServer("localhost\\SQLEXPRESS", source_db);
+
+ var config = builder.Build();
+
+ String config_path = Path.Combine(temp_folder, "schema.xml");
+
+ config.ToFile(config_path);
+
+ ExaminerProcess process = new ExaminerProcess(config_path, ExaminerProcessType.Schema);
+ var result = process.Execute().Result;
+
+ Assert.AreEqual(result.ExitCode, ExaminerProcessExitCode.Success);
+ }
}
}