aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/Tango.UnitTesting
diff options
context:
space:
mode:
authorRoy Ben-Shabat <Roy@Twine-s.com>2018-08-21 10:50:41 +0300
committerRoy Ben-Shabat <Roy@Twine-s.com>2018-08-21 10:50:41 +0300
commitb4a1c833f0e67835e89961e77329efe5bf2a7797 (patch)
tree94354be095256a33d6d2ee285c183686e5e85c39 /Software/Visual_Studio/Tango.UnitTesting
parent51afc4f6a17383e91a72c2ce060e82604d43c3a8 (diff)
downloadTango-b4a1c833f0e67835e89961e77329efe5bf2a7797.tar.gz
Tango-b4a1c833f0e67835e89961e77329efe5bf2a7797.zip
Refactored ObservablesContext to use DataSource object!
Upgraded to .NET 4.7.2 !!!
Diffstat (limited to 'Software/Visual_Studio/Tango.UnitTesting')
-rw-r--r--Software/Visual_Studio/Tango.UnitTesting/DAL_TST.cs6
-rw-r--r--Software/Visual_Studio/Tango.UnitTesting/SQLExaminer_TST.cs7
-rw-r--r--Software/Visual_Studio/Tango.UnitTesting/Synchronization_TST.cs4
-rw-r--r--Software/Visual_Studio/Tango.UnitTesting/Tango.UnitTesting.csproj2
4 files changed, 10 insertions, 9 deletions
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<CoreSettings>().DataBaseSource, false))
+ using (var db = new DAL.Remote.DB.RemoteDB(SettingsManager.Default.GetOrCreate<CoreSettings>().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<CoreSettings>().DataBaseSource, false))
+ using (var db = new DAL.Remote.DB.RemoteDB(SettingsManager.Default.GetOrCreate<CoreSettings>().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<CoreSettings>().DataBaseSource, false))
+ using (var remoteDB = new remote.RemoteDB(SettingsManager.Default.GetOrCreate<CoreSettings>().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<CoreSettings>().DataBaseSource, false))
+ using (var remoteDB = new remote.RemoteDB(SettingsManager.Default.GetOrCreate<CoreSettings>().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 @@
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>Tango.UnitTesting</RootNamespace>
<AssemblyName>Tango.UnitTesting</AssemblyName>
- <TargetFrameworkVersion>v4.6</TargetFrameworkVersion>
+ <TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<ProjectTypeGuids>{3AC096D0-A1C2-E12C-1390-A8335801FDAB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">15.0</VisualStudioVersion>