public void DeleteRows_WhenSourceFileAndDestinationFileMatch()
            {
                // Arrange
                SUT    _clientDb       = new SUT(@"E:\Pst Backup\Test Files\dbForDeletingFile.sqlite3");
                string sourceFile      = @"E:\Pst Backup\Pst Files\Année 2008.pst";
                string destinationFile = @"\\akio9901lms.ad.fr\Pst Backup\Pst Files\Année 2008.pst.partial";

                System.IO.FileInfo dbFile = new System.IO.FileInfo(_clientDb.GetDbPath);

                // Act
                if (dbFile.Exists)
                {
                    dbFile.Delete();
                    dbFile.Refresh();
                    Assert.IsFalse(dbFile.Exists);
                }
                _clientDb.CreateDb();
                _clientDb.RegisterNewPstFile(1, sourceFile, destinationFile);
                Assert.IsTrue(_clientDb.IsPstFileRegistered(sourceFile));
                Assert.IsTrue(_clientDb.GetHashes(1).Count == 0);
                _clientDb.DeletePstFile(sourceFile);

                // Assert
                Assert.IsFalse(_clientDb.IsPstFileRegistered(sourceFile));
                Assert.IsTrue(_clientDb.GetHashes(1).Count == 0);
            }
 public void TestInitialize()
 {
     if (SUT.IsDbExists(_clientDb.GetDbPath))
     {
         System.IO.File.Delete(_clientDb.GetDbPath);
     }
     _clientDb.CreateDb();
 }
 public void TestInitialize()
 {
     if (SUT.IsDbExists(_clientDb.GetDbPath))
     {
         System.IO.File.Delete(_clientDb.GetDbPath);
     }
     _clientDb.CreateDb();
     _clientDb.InsertHash(1, 0, "00000000000000000000000000000000");
     _clientDb.InsertHash(1, 1, "11111111111111111111111111111111");
     _clientDb.InsertHash(1, 2, "22222222222222222222222222222222");
     _clientDb.InsertHash(1, 3, "33333333333333333333333333333333");
     _clientDb.InsertHash(1, 4, "44444444444444444444444444444444");
     _clientDb.InsertHash(1, 5, "55555555555555555555555555555555");
 }
            public void ReturnTrue_WhenTheDbFileExists()
            {
                // Arrange
                System.IO.FileInfo dbFile = new System.IO.FileInfo(@"E:\Pst Backup\Test Files\dbTest.sqlite3");

                // Act
                if (dbFile.Exists)
                {
                    dbFile.Delete();
                    dbFile.Refresh();
                    Assert.IsFalse(dbFile.Exists);
                }

                _clientDb.CreateDb();

                // Assert
                Assert.IsTrue(SUT.IsDbExists(dbFile.FullName));
            }
            public void TestInitialize()
            {
                if (SUT.IsDbExists(_clientDb.GetDbPath))
                {
                    System.IO.File.Delete(_clientDb.GetDbPath);
                    Assert.IsFalse(SUT.IsDbExists(_clientDb.GetDbPath));
                }
                _clientDb.CreateDb();
                _clientDb.Connect();
                string hash = String.Empty;

                for (int i = 0; i < 120; i++)
                {
                    char c = (char)(48 + (i % 10));
                    hash = new string(c, 32);
                    _clientDb.InsertHashToConnectedDb(1, i, hash);
                }
                _clientDb.Disconnect();
            }
            public void ReturnFalse_WhenTheDbFileDoesNotExists()
            {
                SUT _clientDb = new SUT(String.Empty);

                Assert.IsFalse(_clientDb.IsDbWellFormated());
            }
            public void ReturnFalse_WhenTheDbFileIsNotWellFormated()
            {
                SUT _clientDb = new SUT(@"E:\Pst Backup\Test Files\Malformed DbFile.sqlite3");

                Assert.IsFalse(_clientDb.IsDbWellFormated());
            }
            public void ReturnTrue_WhenTheDbFileIsWellFormated()
            {
                SUT _clientDb = new SUT(@"E:\Pst Backup\Test Files\WellFormated DbFile.sqlite3");

                Assert.IsTrue(_clientDb.IsDbWellFormated());
            }
 public void ReturnFalse_WhenTheDbFileDoesNotExists()
 {
     Assert.IsFalse(SUT.IsDbExists(String.Empty));
 }