From b4a1c833f0e67835e89961e77329efe5bf2a7797 Mon Sep 17 00:00:00 2001 From: Roy Ben-Shabat Date: Tue, 21 Aug 2018 10:50:41 +0300 Subject: Refactored ObservablesContext to use DataSource object! Upgraded to .NET 4.7.2 !!! --- Software/Visual_Studio/Tango.UnitTesting/DAL_TST.cs | 6 +++--- Software/Visual_Studio/Tango.UnitTesting/SQLExaminer_TST.cs | 7 ++++--- Software/Visual_Studio/Tango.UnitTesting/Synchronization_TST.cs | 4 ++-- Software/Visual_Studio/Tango.UnitTesting/Tango.UnitTesting.csproj | 2 +- 4 files changed, 10 insertions(+), 9 deletions(-) (limited to 'Software/Visual_Studio/Tango.UnitTesting') diff --git a/Software/Visual_Studio/Tango.UnitTesting/DAL_TST.cs b/Software/Visual_Studio/Tango.UnitTesting/DAL_TST.cs index 305849694..0ea7b59ef 100644 --- a/Software/Visual_Studio/Tango.UnitTesting/DAL_TST.cs +++ b/Software/Visual_Studio/Tango.UnitTesting/DAL_TST.cs @@ -17,7 +17,7 @@ namespace Tango.UnitTesting { String guid = Guid.NewGuid().ToString(); - using (var db = new DAL.Remote.DB.RemoteDB(SettingsManager.Default.GetOrCreate().DataBaseSource, false)) + using (var db = new DAL.Remote.DB.RemoteDB(SettingsManager.Default.GetOrCreate().DataSource)) { var action = new DAL.Remote.DB.ACTION_TYPES(); action.CODE = 1; @@ -30,7 +30,7 @@ namespace Tango.UnitTesting db.SaveChanges(); } - using (var db = new DAL.Remote.DB.RemoteDB(SettingsManager.Default.GetOrCreate().DataBaseSource, false)) + using (var db = new DAL.Remote.DB.RemoteDB(SettingsManager.Default.GetOrCreate().DataSource)) { var action = db.ACTION_TYPES.Single(x => x.GUID == guid); db.ACTION_TYPES.Remove(action); @@ -67,7 +67,7 @@ namespace Tango.UnitTesting [TestMethod] public void Validate_SQLite_Connection_Using_Observables() { - using (ObservablesContext db = ObservablesContext.CreateDefault(@"D:\Development\Tango\Software\DB\Tango.db")) + using (ObservablesContext db = ObservablesContext.CreateDefault(@"D:\Development\Tango\Software\DB\Tango.db", DataSourceType.SQLite)) { var actions = db.ActionTypes.ToList(); } diff --git a/Software/Visual_Studio/Tango.UnitTesting/SQLExaminer_TST.cs b/Software/Visual_Studio/Tango.UnitTesting/SQLExaminer_TST.cs index 5ab70938c..5b7ce16ca 100644 --- a/Software/Visual_Studio/Tango.UnitTesting/SQLExaminer_TST.cs +++ b/Software/Visual_Studio/Tango.UnitTesting/SQLExaminer_TST.cs @@ -9,6 +9,7 @@ using System.Text; using System.Threading.Tasks; using Tango.BL; using Tango.BL.Entities; +using Tango.Core; using Tango.Core.DB; using Tango.Core.IO; using Tango.SQLExaminer; @@ -274,7 +275,7 @@ namespace Tango.UnitTesting String job_guid = String.Empty; - using (var context = ObservablesContext.CreateDefault("localhost\\SQLEXPRESS", target_db)) + using (var context = ObservablesContext.CreateDefault("localhost\\SQLEXPRESS", target_db, DataSourceType.SQLServer)) { context.Configuration.LazyLoadingEnabled = false; Assert.IsTrue(context.Machines.Count() == 1); @@ -323,13 +324,13 @@ namespace Tango.UnitTesting Assert.IsTrue(data_report.HasDifferences); //Check the new job exists on source.. - using (var context = ObservablesContext.CreateDefault("localhost\\SQLEXPRESS", source_db)) + using (var context = ObservablesContext.CreateDefault("localhost\\SQLEXPRESS", source_db, DataSourceType.SQLServer)) { Assert.IsTrue(context.Jobs.Any(x => x.Guid == job_guid)); } //Now change configuration in source and push to machine - using (var context = ObservablesContext.CreateDefault("localhost\\SQLEXPRESS", source_db)) + using (var context = ObservablesContext.CreateDefault("localhost\\SQLEXPRESS", source_db, DataSourceType.SQLServer)) { var machine = context.Machines.SingleOrDefault(x => x.SerialNumber == machine_serial_number); machine.Configuration.Name = "Test Name " + new Random().Next(0, 1000); diff --git a/Software/Visual_Studio/Tango.UnitTesting/Synchronization_TST.cs b/Software/Visual_Studio/Tango.UnitTesting/Synchronization_TST.cs index e4bbcaf51..d6713c2ac 100644 --- a/Software/Visual_Studio/Tango.UnitTesting/Synchronization_TST.cs +++ b/Software/Visual_Studio/Tango.UnitTesting/Synchronization_TST.cs @@ -21,7 +21,7 @@ namespace Tango.UnitTesting { var console = Helper.InitializeLogging(true); - using (var remoteDB = new remote.RemoteDB(SettingsManager.Default.GetOrCreate().DataBaseSource, false)) + using (var remoteDB = new remote.RemoteDB(SettingsManager.Default.GetOrCreate().DataSource)) { using (var localDB = new local.LocalDB(Helper.GetSQLiteFilePath())) { @@ -45,7 +45,7 @@ namespace Tango.UnitTesting [TestMethod] public void Generate_Demo_Remote_Machine() { - using (var remoteDB = new remote.RemoteDB(SettingsManager.Default.GetOrCreate().DataBaseSource, false)) + using (var remoteDB = new remote.RemoteDB(SettingsManager.Default.GetOrCreate().DataSource)) { var organization = new remote.ORGANIZATION() { diff --git a/Software/Visual_Studio/Tango.UnitTesting/Tango.UnitTesting.csproj b/Software/Visual_Studio/Tango.UnitTesting/Tango.UnitTesting.csproj index 0bf97caa6..7a37655a8 100644 --- a/Software/Visual_Studio/Tango.UnitTesting/Tango.UnitTesting.csproj +++ b/Software/Visual_Studio/Tango.UnitTesting/Tango.UnitTesting.csproj @@ -9,7 +9,7 @@ Properties Tango.UnitTesting Tango.UnitTesting - v4.6 + v4.7.2 512 {3AC096D0-A1C2-E12C-1390-A8335801FDAB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} 15.0 -- cgit v1.3.1