diff options
Diffstat (limited to 'Software/Visual_Studio/Tango.UnitTesting')
| -rw-r--r-- | Software/Visual_Studio/Tango.UnitTesting/DAL_TST.cs | 20 | ||||
| -rw-r--r-- | Software/Visual_Studio/Tango.UnitTesting/Synchronization_TST.cs | 18 |
2 files changed, 27 insertions, 11 deletions
diff --git a/Software/Visual_Studio/Tango.UnitTesting/DAL_TST.cs b/Software/Visual_Studio/Tango.UnitTesting/DAL_TST.cs index e9fa5e6ba..88ea53900 100644 --- a/Software/Visual_Studio/Tango.UnitTesting/DAL_TST.cs +++ b/Software/Visual_Studio/Tango.UnitTesting/DAL_TST.cs @@ -17,21 +17,21 @@ namespace Tango.UnitTesting using (var db = new DAL.Remote.DB.RemoteDB(SettingsManager.Default.DataBase.SQLServerAddress, false)) { - var action = new DAL.Remote.DB.ACTION(); + var action = new DAL.Remote.DB.ACTION_TYPES(); action.CODE = 1; action.NAME = "Action 1"; action.DESCRIPTION = "Description 1"; action.GUID = guid; - action.LAST_UPDATED = DateTime.Now; + action.LAST_UPDATED = DateTime.UtcNow; - db.ACTIONS.Add(action); + db.ACTION_TYPES.Add(action); db.SaveChanges(); } using (var db = new DAL.Remote.DB.RemoteDB(SettingsManager.Default.DataBase.SQLServerAddress, false)) { - var action = db.ACTIONS.Single(x => x.GUID == guid); - db.ACTIONS.Remove(action); + var action = db.ACTION_TYPES.Single(x => x.GUID == guid); + db.ACTION_TYPES.Remove(action); db.SaveChanges(); } } @@ -43,21 +43,21 @@ namespace Tango.UnitTesting using (var db = new DAL.Local.DB.LocalDB(Helper.GetSQLiteFilePath())) { - var action = new DAL.Local.DB.ACTION(); + var action = new DAL.Local.DB.ACTION_TYPES(); action.CODE = 1; action.NAME = "Action 1"; action.DESCRIPTION = "Description 1"; action.GUID = guid; - db.ACTIONS.Add(action); + db.ACTION_TYPES.Add(action); db.SaveChanges(); } using (var db = new DAL.Local.DB.LocalDB(Helper.GetSQLiteFilePath())) { - var actions = db.ACTIONS.ToList(); - var action = db.ACTIONS.Single(x => x.GUID == guid); - db.ACTIONS.Remove(action); + var actions = db.ACTION_TYPES.ToList(); + var action = db.ACTION_TYPES.Single(x => x.GUID == guid); + db.ACTION_TYPES.Remove(action); db.SaveChanges(); } } diff --git a/Software/Visual_Studio/Tango.UnitTesting/Synchronization_TST.cs b/Software/Visual_Studio/Tango.UnitTesting/Synchronization_TST.cs index 765d93115..3b949cf90 100644 --- a/Software/Visual_Studio/Tango.UnitTesting/Synchronization_TST.cs +++ b/Software/Visual_Studio/Tango.UnitTesting/Synchronization_TST.cs @@ -20,7 +20,23 @@ namespace Tango.UnitTesting { var console = Helper.InitializeLogging(true); - RemoteDBSynchronizer.Synchronize(Helper.GetSQLiteFilePath(), "1234"); + using (var remoteDB = new remote.RemoteDB(SettingsManager.Default.DataBase.SQLServerAddress, false)) + { + using (var localDB = new local.LocalDB(Helper.GetSQLiteFilePath())) + { + RemoteDBComparer comparer = new RemoteDBComparer(remoteDB, localDB, "1111"); + var diffs = comparer.Compare(); + } + } + + console.WaitForConsoleExit().Wait(); + } + + [TestMethod] + public void Synchronize_Remote_And_Local() + { + var console = Helper.InitializeLogging(true); + RemoteDBSynchronizer.Synchronize(Helper.GetSQLiteFilePath(), "1111", true); console.WaitForConsoleExit().Wait(); } |
