예제 #1
0
        public void UnzipMixingFromAllFilesWhereZipsContainsSameFileInfo()
        {
            //Arrange
            var steps = new FileOpsBuilder()
                        .AddConfiguration(_settingsUnzipFromMultipleZips)
                        .AddConfiguration(_sharedSettings)
                        .Build();

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

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

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

            //Act
            fileOpsManager.Execute();

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

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


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

            //Act
            fileOpsManager.Execute();

            //Assert

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


            IFileOpsManager fileOpsManager = new 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));
        }
예제 #5
0
        public void UnzipMixingFromAllFilesWhereZipsDoesntContainSameFileInfo()
        {
            //Arrange
            var steps = new FileOpsBuilder()
                        .AddConfiguration(_settingsUnzipFromMultipleZips)
                        .AddConfiguration(_sharedSettings)
                        .Build();


            FileProvider.Sftp.FromSettings.DeleteOneFile(_twoFilesInsideOneZip);

            IFileOpsManager fileOpsManager = new 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")));
        }