Ejemplo n.º 1
0
        public void UnzipMixingFromAllFilesWhereZipsContainsSameFileInfo()
        {
            //Arrange
            var steps = new FileOpsBuilder()
                        .AddConfiguration(_settingsUnzipFromMultipleZips)
                        .AddConfiguration(_sharedSettings)
                        .Build();

            IFileOpsManager fileOpsManager = new ExecutiveOffice.EDT.FileOps.Pipe.FileOpsManager(steps, "identifier");

            //Act
            fileOpsManager.Execute();
        }
Ejemplo n.º 2
0
        public void UnzipZeroItemsFromOneFile()
        {
            //Arrange
            var steps = new FileOpsBuilder()
                        .AddConfiguration(_settingsUnzipZeroFile)
                        .AddConfiguration(_sharedSettings)
                        .Build();

            IFileOpsManager fileOpsManager = new ExecutiveOffice.EDT.FileOps.Pipe.FileOpsManager(steps, "identifier");

            //Act
            fileOpsManager.Execute();

            //Assert
            FileProvider.Sftp.ToSettings.CopyContentTo(_workingDirectory);

            Assert.AreEqual(0, _workingDirectory.GetFiles().Length);
        }
Ejemplo n.º 3
0
        public void UnzipFromEmptyFolder()
        {
            //Arrange
            var steps = new FileOpsBuilder()
                        .AddConfiguration(_settingsUnzipEmptyfolder)
                        .AddConfiguration(_sharedSettings)
                        .Build();


            IFileOpsManager fileOpsManager = new ExecutiveOffice.EDT.FileOps.Pipe.FileOpsManager(steps, "identifier");

            //Act
            fileOpsManager.Execute();

            //Assert

            Assert.AreEqual(0, _workingDirectory.GetFiles().Length);
        }
Ejemplo n.º 4
0
        public void UnzipSucessfullyFromSftp()
        {
            //Arrange
            var steps = new FileOpsBuilder()
                        .AddConfiguration(_unzipMultipleFiles)
                        .AddConfiguration(_sharedSettings)
                        .Build();


            IFileOpsManager fileOpsManager = new ExecutiveOffice.EDT.FileOps.Pipe.FileOpsManager(steps, "identifier");

            //Act
            fileOpsManager.Execute();

            //Assert
            FileProvider.Sftp.ToSettings.CopyContentTo(_workingDirectory);

            Assert.AreEqual(2, _workingDirectory.GetFiles().Length);
            Assert.IsTrue(File.Exists(_testFile1.FullName));
            Assert.IsTrue(File.Exists(_testFile2.FullName));
        }
Ejemplo n.º 5
0
        public void UnzipMixingFromAllFilesWhereZipsDoesntContainSameFileInfo()
        {
            //Arrange
            var steps = new FileOpsBuilder()
                        .AddConfiguration(_settingsUnzipFromMultipleZips)
                        .AddConfiguration(_sharedSettings)
                        .Build();


            FileProvider.Sftp.FromSettings.DeleteOneFile(_twoFilesInsideOneZip);

            IFileOpsManager fileOpsManager = new ExecutiveOffice.EDT.FileOps.Pipe.FileOpsManager(steps, "identifier");

            //Act
            fileOpsManager.Execute();

            //Assert
            FileProvider.Sftp.ToSettings.CopyContentTo(_workingDirectory);

            Assert.AreEqual(3, _workingDirectory.GetFiles().Length);
            Assert.IsTrue(File.Exists(_testFile1.FullName));
            Assert.IsTrue(File.Exists(Path.Combine(_workingDirectory.FullName, "ClientInput2.csv")));
            Assert.IsTrue(File.Exists(Path.Combine(_workingDirectory.FullName, "ClientInput1.csv")));
        }