public void FileChangeEntryTest()
 {
     NinjectReg = new Registrator();
     var LogEngine = NinjectReg.kernel.Get<LogEngine>();
     try
     {
         LogEngine.CreateFileChangeLog(5, "Test");
         Assert.IsTrue(true);
     }
     catch (Exception e)
     {
         Debug.WriteLine(e.ToString());
         Assert.IsTrue(false);
     }
 }
        public void CommitEntryTest()
        {
            NinjectReg = new Registrator();
            var LDAL = NinjectReg.kernel.Get<LogEngine>();
            var log = LDAL.CreateErrorLog("Test", 0, "Test", 0);

            try
            {
                LDAL.CommitLog(log);
                Assert.IsTrue(true);
            }
            catch (Exception e)
            {
                Debug.WriteLine(e.ToString());
                Assert.IsTrue(false);
            }
        }
        public void CreateErrorLogTest()
        {
            NinjectReg = new Registrator();
            var LogManager = NinjectReg.kernel.Get<LogManager>();

            try
            {
                LogManager.CreateErrorLog("exception (unit test)", 8, "dev/unit.test", 4);
                Assert.IsTrue(true);
            }
            catch (Exception e)
            {
                Debug.WriteLine(e.ToString());
                Assert.IsTrue(false);
            }
        }
        public void FileManagerSyncTest()
        {
            NinjectReg = new Registrator();
            var FileEngine = NinjectReg.kernel.Get<FileEngine>();

            var sDir = @"C:\testSource";
            var tDir = @"C:\NewTar";
            var filter = FileEngine.CreateFilter();
            var options = FileEngine.SetOptions();
            FileEngine.CheckTargetDirExists(tDir);
            var SourceProvider = FileEngine.CreateProvider(sDir, filter, options);
            var DestinationProvider = FileEngine.CreateProvider(tDir, filter, options);
            FileEngine.DetectChanges(SourceProvider);
            SourceProvider = FileEngine.CreateProvider(sDir, filter, options);
            SourceProvider = FileEngine.SetPreviewModeFlag(SourceProvider, true);
            DestinationProvider = FileEngine.SetPreviewModeFlag(DestinationProvider, true);
            DestinationProvider = FileEngine.AttachApplyingChangeEventHandler(DestinationProvider);
            DestinationProvider = FileEngine.AttachAppliedChangeEventHandler(DestinationProvider);
            DestinationProvider = FileEngine.AttachSkippedChangeEventHandler(DestinationProvider);
            var agent = FileEngine.CreateSyncOrchestrator(SourceProvider,DestinationProvider);
            agent = FileEngine.SetSyncDirection(agent);
            FileEngine.Synchronize(agent);
        }
 public void SyncTest()
 {
     NinjectReg = new Registrator();
     var FileEngine = NinjectReg.kernel.Get<FileEngine>();
 }
 public void ExecuteQuery()
 {
     NinjectReg = new Registrator();
     var LogEngine = NinjectReg.kernel.Get<LogEngine>();
     var query = LogEngine.CreateQuery();
     LogEngine.ExecuteQuery(query);
 }
        public void BigTest()
        {
            NinjectReg = new Registrator();
            var FileEngine = NinjectReg.kernel.Get<FileEngine>();

            FileSyncProvider sourceProvider = null;
            FileSyncProvider destinationProvider = null;

            try
            {
                sourceProvider = new FileSyncProvider(
                    @"C:\testSource", null, FileEngine.SetOptions());
                destinationProvider = new FileSyncProvider(
                    @"C:\targetDir", null, FileEngine.SetOptions());

                SyncOrchestrator agent = new SyncOrchestrator();
                agent.LocalProvider = sourceProvider;
                agent.RemoteProvider = destinationProvider;
                agent.Direction = SyncDirectionOrder.Upload; // Sync source to destination

                Console.WriteLine("Synchronizing changes to replica: " +
                    destinationProvider.RootDirectoryPath);
                //agent.Synchronize();
                Assert.IsTrue(true);
            }
            finally
            {
                // Release resources
                if (sourceProvider != null) sourceProvider.Dispose();
                if (destinationProvider != null) destinationProvider.Dispose();
            }
        }
 public void RegistratorTest()
 {
     NinjectReg = new Registrator();
 }
 public void CreateSyncOptionsTest()
 {
     NinjectReg = new Registrator();
     var FileEngine = NinjectReg.kernel.Get<FileEngine>();
     var test = FileEngine.SetOptions();
 }
 public void CreateSyncFilterTest()
 {
     NinjectReg = new Registrator();
     var FileEngine = NinjectReg.kernel.Get<FileEngine>();
     var test = FileEngine.CreateFilter();
 }
 public void UserNameQuery()
 {
     NinjectReg = new Registrator();
     var LogEngine = NinjectReg.kernel.Get<LogEngine>();
     var query = LogEngine.CreateQuery();
     var options = new SearchOptions { UserName = "******" };
     IEnumerable<History> result = LogEngine.UserNameQuery(query, options);
     foreach (History x in result.ToList())
     {
         if (!(x.UserName == "drmurtha"))
         {
             Assert.IsFalse(true);
             break;
         }
     }
     Assert.IsTrue(true);
 }
 public void NinjectLogManagerTest()
 {
     NinjectReg = new Registrator();
     var LogManager = NinjectReg.kernel.Get<LogManager>();
     //var result = LogManager.RunSampleQueries();
     //foreach (History a in result)
     //{
     //    Debug.WriteLine(a.LogTime.ToString() + " " + a.LogDate.ToShortDateString() + ", " + a.LogType.Description.ToString() + ", " + a.InteractionType.Description.ToString() + ", " + a.Domain.ToString() + "\\" + a.UserName.ToString());
     //}
 }
 public void LogTypeQuery()
 {
     NinjectReg = new Registrator();
     var LogEngine = NinjectReg.kernel.Get<LogEngine>();
     var query = LogEngine.CreateQuery();
     var options = new SearchOptions { LogTypeId = 5 };
     LogEngine.LogTypeQuery(query, options);
 }
 public void FileOperationQuery()
 {
     NinjectReg = new Registrator();
     var LogEngine = NinjectReg.kernel.Get<LogEngine>();
     var query = LogEngine.CreateQuery();
     int operation = 4;
     var options = new SearchOptions {FileOperationId = 4 };
     try
     {
         IEnumerable<History> result = LogEngine.FileOperationQuery(query, options);
         foreach (History x in result.ToList())
         {
             if (!(x.FileOperationId == operation))
             {
                 Assert.IsFalse(true);
                 break;
             }
         }
     }
     catch (Exception e)
     {
         Assert.Fail();
     }
     Assert.IsTrue(true);
 }
        public void CreateSyncLogTest()
        {
            NinjectReg = new Registrator();
            var LogManager = NinjectReg.kernel.Get<LogManager>();

            try
            {
                LogManager.CreateSyncLog(4);
                Assert.IsTrue(true);
            }
            catch (Exception e)
            {
                Debug.WriteLine(e.ToString());
                Assert.IsTrue(false);
            }
        }
 public void MultiFilterLogQuery2()
 {
     NinjectReg = new Registrator();
     var LogManager = NinjectReg.kernel.Get<LogManager>();
     var options = new SearchOptions
     {
         LogTypeId = 5,
         FileOperationId = 4,
         UserName = "******",
         StartDate = -6,
         StopDate = 1
     };
     var result = LogManager.PerformQuery(options);
     foreach (History a in result)
     {
         Debug.WriteLine(a.LogTime.ToString() + " " + a.LogDate.ToShortDateString() + ", " + a.LogType.Description.ToString() + ", " + a.InteractionType.Description.ToString() + ", " + a.Domain.ToString() + "\\" + a.UserName.ToString());
     }
 }
 public void CreateSyncOrchestratorTest()
 {
     NinjectReg = new Registrator();
     var FileEngine = NinjectReg.kernel.Get<FileEngine>();
     FileEngine.CreateSyncOrchestrator(FileEngine.CreateProvider(@"c:\testSource", FileEngine.CreateFilter(), FileEngine.SetOptions()), FileEngine.CreateProvider(@"c:\testDir", FileEngine.CreateFilter(), FileEngine.SetOptions()));
 }
 public void SyncLogEntry()
 {
     NinjectReg = new Registrator();
     var LogEngine = NinjectReg.kernel.Get<LogEngine>();
     var result = LogEngine.CreateQuery();
     Assert.IsInstanceOfType(result, typeof(IEnumerable<History>));
 }
 public void DisposeSyncProviderTest()
 {
     NinjectReg = new Registrator();
     var FileEngine = NinjectReg.kernel.Get<FileEngine>();
     var test = FileEngine.CreateProvider(@"c:\testSource", FileEngine.CreateFilter(), FileEngine.SetOptions());
 }
 public void SetPreviewModeTest()
 {
     NinjectReg = new Registrator();
     var FileEngine = NinjectReg.kernel.Get<FileEngine>();
     var test = FileEngine.CreateProvider(@"c:\testSource", FileEngine.CreateFilter(), FileEngine.SetOptions());
     test = FileEngine.SetPreviewModeFlag(test, true);
     Assert.IsTrue(test.PreviewMode);
 }
 public void DateQuery()
 {
     NinjectReg = new Registrator();
     var LogEngine = NinjectReg.kernel.Get<LogEngine>();
     var query = LogEngine.CreateQuery();
     var options = new SearchOptions
     {
         StartDate = -2,
         StopDate = 0
     };
     IEnumerable<History> result = LogEngine.DateRangeQuery(query,options);
     foreach (History x in result.ToList())
     {
         if (!((x.LogDate >= DateTime.Now.AddDays(-2) && (x.LogDate <= DateTime.Now.AddDays(0)))))
         {
             Assert.IsFalse(true);
             break;
         }
     }
     Assert.IsTrue(true);
 }