Esempio n. 1
0
        public void Run_should_parse_localfile_paths(string inputFilePath, string expectedFilePath)
        {
            // given
            _fileProviderMock.CurrentDirectory = "c:\\currentdir";
            var task   = new PowershellFileTask(_fileProviderMock, _runnerMock);
            var config = new PowershellFileTaskConfig();

            var properties = new Dictionary <object, object>();

            properties["uri"] = inputFilePath;
            task.SetConfiguration(config, properties);

            // when
            task.Run(_logger);

            // then
            Assert.That(_runnerMock.ActualTempFilename, Is.EqualTo(expectedFilePath));
        }
Esempio n. 2
0
        public void Run_should_parse_and_run_remotefiles()
        {
            // given
            _fileProviderMock.DownloadContent = "echo hello-world";
            _fileProviderMock.TempFilePath    = "expected-tempfilename.ps1";
            var task = new PowershellFileTask(_fileProviderMock, _runnerMock);

            var config = new PowershellFileTaskConfig();

            var properties = new Dictionary <object, object>();

            properties["uri"] = "http://www.example.com/powershell.ps1";
            task.SetConfiguration(config, properties);

            // when
            task.Run(_logger);

            // then
            Assert.That(_runnerMock.ActualTempFilename, Is.EqualTo(_fileProviderMock.TempFilePath));
        }