示例#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")));
        }