Esempio n. 1
0
 public void DeleteArchive(TransferArchive archive)
 {
     try
     {
         File.Delete(archive.FullName);
     }
     catch (Exception)
     {
         throw;
     }
 }
Esempio n. 2
0
 public void DeleteArchive(TransferArchive archive)
 {
     try
     {
         _videoManagementRepository.DeleteArchive(archive);
     }
     catch (Exception ex)
     {
         //_mail.SendEmail();
         throw ex;
     }
 }
        public void MoveArchiveTest(string fullName, string pathFolder)
        {
            // Arrange
            var checksum        = _videoManagementAppService.Checksum(fullName);
            var transferArchive = new TransferArchive(fullName, pathFolder);

            // Act
            var result = _videoManagementAppService.MoveArchive(transferArchive);

            // Assert
            Assert.AreEqual(result.CheckSum, checksum);
        }
        public void DeleteArchiveTest(string fullName)
        {
            // Arrange
            FileInfo file            = new FileInfo(fullName);
            var      transferArchive = new TransferArchive(fullName, string.Empty);

            // Act
            _videoManagementAppService.DeleteArchive(transferArchive);
            var result = file.Exists;

            // Assert
            Assert.False(result);
        }
Esempio n. 5
0
        public void MoveArchive(TransferArchive archive)
        {
            try
            {
                FileInfo file = new FileInfo(archive.FullName);

                if (archive.PathTarget != string.Empty)
                {
                    file.MoveTo(archive.PathTarget + "\\" + file.Name);
                }
            }
            catch (Exception)
            {
                throw;
            }
        }
Esempio n. 6
0
        public TransferArchiveResponse CopyArchive(TransferArchive archive)
        {
            try
            {
                var cheksum = Checksum(archive.FullName);
                TransferArchiveResponse transferArchiveResponse = new TransferArchiveResponse(cheksum);

                _videoManagementRepository.CopyArchive(archive);

                return(transferArchiveResponse);
            }
            catch (Exception ex)
            {
                //_mail.SendEmail();
                throw ex;
            }
        }