public void WatchProcessNotepadTest() { IWatcher watcher = new ProcessWatcher() { Id = PluginUtilities.GetUniqueId(), LoggingService = ServicesContainer.ServicesProvider.GetLoggingService(nameof(ProcessWatcher)), ProcessName = "notepad" }; var watcherResult = watcher.Watch(); Assert.IsNotNull(watcherResult); Assert.IsFalse(watcherResult.Result); var process = System.Diagnostics.Process.Start("notepad"); Assert.IsNotNull(process); Thread.Sleep(1000); watcherResult = watcher.Watch(); Assert.IsNotNull(watcherResult); Assert.IsTrue(watcherResult.Result); Assert.IsTrue(watcherResult.WatchingArguments.HasArgument(ProcessWatcherResultArgs.ProcessName)); Assert.IsTrue(watcherResult.WatchingArguments.HasArgument(ProcessWatcherResultArgs.ProcessId)); Assert.AreEqual(process.ProcessName, watcherResult.WatchingArguments.GetValue <string>(ProcessWatcherResultArgs.ProcessName)); Assert.AreEqual(process.Id, watcherResult.WatchingArguments.GetValue <int>(ProcessWatcherResultArgs.ProcessId)); process.Kill(); }
public void WatchForFilesByPatternTest() { string remoteWorkingDir = "/test"; FtpWatcher watcher = new FtpWatcher { Id = PluginUtilities.GetUniqueId(), LoggingService = ServicesContainer.ServicesProvider.GetLoggingService(nameof(FtpWatcher)), Host = FtpTestCredentials.Host, Username = FtpTestCredentials.User, Password = FtpTestCredentials.Password, Port = FtpTestCredentials.Port, RemoteWorkingDir = remoteWorkingDir, SelectFiles = true }; watcher.SearchPattern = "prefix*.pat"; var localWriteDir = Path.Combine(Environment.ExpandEnvironmentVariables(LocalWorkingDir), remoteWorkingDir.Trim('/')); var fileNamePath = CreateTestFile(localWriteDir, "prefix", "pat"); var otherFileNamePath = CreateTestFile(localWriteDir); var watcherResult = watcher.Watch(); Assert.IsNotNull(watcherResult); Assert.AreEqual(true, watcherResult.Result); Assert.IsNotNull(watcherResult.WatchingArguments); Assert.IsTrue(watcherResult.WatchingArguments.HasArgument(FtpWatcherResultArgs.RemoteFilesCollection)); Assert.IsTrue(watcherResult.WatchingArguments.GetValue <List <string> >(FtpWatcherResultArgs.RemoteFilesCollection).Any()); Assert.AreEqual(1, watcherResult.WatchingArguments.GetValue <List <string> >(FtpWatcherResultArgs.RemoteFilesCollection).Count); var watchedFile = watcherResult.WatchingArguments.GetValue <List <string> >(FtpWatcherResultArgs .RemoteFilesCollection).Single(); Assert.AreEqual(UriHelper.BuildPath("/", remoteWorkingDir, Path.GetFileName(fileNamePath)), watchedFile); }
public void DeleteFilesTest() { var localWriteDir = Path.GetDirectoryName(Environment.ExpandEnvironmentVariables(LocalWorkingDir)); FtpDeleteAction ftpDeleteAction = new FtpDeleteAction() { Id = PluginUtilities.GetUniqueId(), LoggingService = ServicesContainer.ServicesProvider.GetLoggingService(nameof(FtpDownloadAction)) }; ftpDeleteAction.Host = FtpTestCredentials.Host; ftpDeleteAction.Username = FtpTestCredentials.User; ftpDeleteAction.Password = FtpTestCredentials.Password; ftpDeleteAction.Port = FtpTestCredentials.Port; ftpDeleteAction.RemoteWorkingDir = "/"; var fileNamePath = CreateTestFile(localWriteDir); var actionResult = ftpDeleteAction.Execute(ArgumentCollection.New() .WithArgument(FtpDownloadActionExecutionArgs.RemoteFilesCollection, new List <string>() { Path.GetFileName(fileNamePath) }) ); Assert.IsNotNull(actionResult); Assert.IsTrue(actionResult.Result); }
public void KillProcessByNameFromExecutionArgsTest() { var processId = StartNotepad(); Assert.AreNotEqual(0, processId); Console.WriteLine($"Created Process with ID {processId}"); Thread.Sleep(1000); KillProcessByNameAction action = new KillProcessByNameAction() { Id = PluginUtilities.GetUniqueId(), LoggingService = ServicesContainer.ServicesProvider.GetLoggingService(nameof(KillProcessByNameAction)), }; var actionResult = action.Execute(ArgumentCollection.New() .WithArgument(KillProcessByNameActionExecutionArgs.ProcessName, "notepad") ); Assert.IsNotNull(actionResult); Assert.IsTrue(actionResult.Result); Assert.IsTrue( actionResult.AdditionalInformation.HasArgument(KillProcessActionResultArgs .ProcessesKilledSuccessfully)); Assert.AreEqual(1, actionResult.AdditionalInformation .GetValue<List<int>>(KillProcessActionResultArgs.ProcessesKilledSuccessfully).Count); Assert.AreEqual(processId, actionResult.AdditionalInformation .GetValue<List<int>>(KillProcessActionResultArgs.ProcessesKilledSuccessfully).Single()); Thread.Sleep(2000); actionResult = action.Execute(ArgumentCollection.New() .WithArgument(KillProcessByNameActionExecutionArgs.ProcessName, "notepad") ); Assert.IsNotNull(actionResult); Assert.IsFalse(actionResult.Result); }
public void DownloadFileFromWorkingDirAndRenameTest() { var localWriteDir = Environment.ExpandEnvironmentVariables(LocalWorkingDir); FtpDownloadAction ftpDownloadAction = new FtpDownloadAction { Id = PluginUtilities.GetUniqueId(), LoggingService = ServicesContainer.ServicesProvider.GetLoggingService(nameof(FtpDownloadAction)), Host = FtpTestCredentials.Host, Username = FtpTestCredentials.User, Password = FtpTestCredentials.Password, Port = FtpTestCredentials.Port, DirectoryPath = LocalDownloadDir, RemoteWorkingDir = "test" }; ftpDownloadAction.RenameDownloaded = true; ftpDownloadAction.RenameDownloadedNewName = "ROUTINDO_"; var fileNamePath = CreateTestFile(localWriteDir); var actionResult = ftpDownloadAction.Execute(ArgumentCollection.New() .WithArgument(FtpDownloadActionExecutionArgs.RemoteFilesCollection, new List <string>() { Path.GetFileName(fileNamePath) }) ); Assert.IsNotNull(actionResult); Assert.IsTrue(actionResult.Result); }
public void MoveFileFailsWhenUsedByAnotherProcess() { var destinationPath = Path.Combine(Path.GetTempPath(), Path.GetRandomFileName()); var moveFileAction = new MoveFileAction() { Id = PluginUtilities.GetUniqueId(), DestinationDirectory = destinationPath }; var sourcePath = Path.Combine(Path.GetTempPath(), Path.GetRandomFileName()); var createdFileStream = File.Create(sourcePath); Assert.IsTrue(File.Exists(sourcePath)); var args = new ArgumentCollection((MoveFileActionExecutionArgs.SourceFilePaths, sourcePath)); var result = moveFileAction.Execute(args); Assert.IsNotNull(result); Assert.IsFalse(result.Result); Assert.IsTrue(File.Exists(sourcePath)); createdFileStream.Close(); // Cleanup File.Delete(sourcePath); Assert.IsFalse(File.Exists(sourcePath)); }
public void SendSampleFileTest() { FtpUploadAction action = new FtpUploadAction() { Id = PluginUtilities.GetUniqueId(), LoggingService = ServicesContainer.ServicesProvider.GetLoggingService(nameof(FtpUploadAction)), Host = FtpTestCredentials.Host, Username = FtpTestCredentials.User, Password = FtpTestCredentials.Password, Port = FtpTestCredentials.Port, DestinationFolderPath = "Data", DestinationFileName = "renamed.txt", UseRemoteTemporaryExtension = true, RemoteTemporaryExtension = "remote", UseLocalTemporaryExtension = true, LocalTemporaryExtension = "local", Overwrite = true, CreateRemoteDirectory = true }; string sourceFileName = Path.Combine(Path.GetTempPath(), "test.txt"); File.WriteAllText(sourceFileName, "Hello world! This is a remote message!"); var result = action.Execute(ArgumentCollection.New() .WithArgument(FtpUploadActionExecutionArgs.SourceFilesCollection, new List <string> { sourceFileName })); Console.WriteLine(result.AttachedException); Assert.IsTrue(result.Result); File.Delete(sourceFileName); }
public void MoveFileTestSuccess() { var destinationPath = Path.Combine(Path.GetTempPath()); var moveFileAction = new MoveFileAction() { Id = PluginUtilities.GetUniqueId(), DestinationDirectory = destinationPath, DestinationPrefix = "RENAMED" }; var sourcePath = Path.Combine(Path.GetTempPath(), Path.GetRandomFileName()); using (var file = File.Create(sourcePath)) { } Assert.IsTrue(File.Exists(sourcePath)); Assert.IsFalse(File.Exists(destinationPath)); var args = new ArgumentCollection((MoveFileActionExecutionArgs.SourceFilePaths, new List <string>() { sourcePath })); var result = moveFileAction.Execute(args); Assert.IsNotNull(result); Assert.IsTrue(result.Result); Assert.IsFalse(File.Exists(sourcePath)); destinationPath = Path.Combine(destinationPath, $"RENAMED{Path.GetFileName(sourcePath)}"); Assert.IsTrue(File.Exists(destinationPath)); // CleanUp File.Delete(destinationPath); }
public void MoveFileFailsWhenDestinationFileAlreadyExist() { var destinationPath = Path.Combine(Path.GetTempPath(), Path.GetRandomFileName()); var moveFileAction = new MoveFileAction() { Id = PluginUtilities.GetUniqueId(), DestinationDirectory = destinationPath }; var filePath = Path.Combine(Path.GetTempPath(), Path.GetRandomFileName()); using (var sourceFile = File.Create(filePath)) { } using (var destinationFile = File.Create(destinationPath)) { } var args = new ArgumentCollection((MoveFileActionExecutionArgs.SourceFilePaths, filePath) ); var result = moveFileAction.Execute(args); Assert.IsNotNull(result); Assert.IsFalse(result.Result); // Clean up File.Delete(filePath); File.Delete(destinationPath); }
public void CreateZipOnSameExistingOptionTest() { var outputDirectory = Path.GetTempPath(); IAction action = new ZipDirectoryAction() { EraseOutputIfExists = true, UseLocationAsOutput = true, Id = PluginUtilities.GetUniqueId(), LoggingService = ServicesContainer.ServicesProvider.GetLoggingService(null) }; var testDir = Path.Combine(Path.GetTempPath(), "TEMPO_TEST"); if (!Directory.Exists(testDir)) { Directory.CreateDirectory(testDir); } File.WriteAllText(Path.Combine(outputDirectory, "TEMPO_TEST.zip"), ""); var actionResult = action.Execute(ArgumentCollection.New() .WithArgument(ZipDirectoryActionExecutionArgs.Directory, testDir)); Assert.IsNotNull(actionResult); Assert.IsTrue(actionResult.Result); }
public void WatchForFilesTest() { string remoteWorkingDir = "/"; FtpWatcher watcher = new FtpWatcher { Id = PluginUtilities.GetUniqueId(), LoggingService = ServicesContainer.ServicesProvider.GetLoggingService(nameof(FtpWatcher)), Host = FtpTestCredentials.Host, Username = FtpTestCredentials.User, Password = FtpTestCredentials.Password, SelectFiles = true }; var localWriteDir = Environment.ExpandEnvironmentVariables(LocalWorkingDir); var fileNamePath = CreateTestFile(localWriteDir); var watcherResult = watcher.Watch(); Assert.IsNotNull(watcherResult); Assert.AreEqual(true, watcherResult.Result); Assert.IsNotNull(watcherResult.WatchingArguments); Assert.IsTrue(watcherResult.WatchingArguments.HasArgument(FtpWatcherResultArgs.RemoteFilesCollection)); Assert.IsTrue(watcherResult.WatchingArguments.GetValue <List <string> >(FtpWatcherResultArgs.RemoteFilesCollection).Any()); Assert.AreEqual(1, watcherResult.WatchingArguments.GetValue <List <string> >(FtpWatcherResultArgs.RemoteFilesCollection).Count); var watchedFile = watcherResult.WatchingArguments.GetValue <List <string> >(FtpWatcherResultArgs .RemoteFilesCollection).Single(); Assert.AreEqual(remoteWorkingDir + Path.GetFileName(fileNamePath), watchedFile); }
public void GetUniqueIdTest() { var uniqueId = PluginUtilities.GetUniqueId(); var upperCaseUniqueId = uniqueId.ToUpper(); Assert.IsFalse(string.IsNullOrWhiteSpace(uniqueId)); // Assert unique Id is generated in upper cases Assert.AreEqual(uniqueId, upperCaseUniqueId); }
public void MoveFileFailsWhenArgumentsNull() { var moveFileAction = new MoveFileAction() { Id = PluginUtilities.GetUniqueId() }; var result = moveFileAction.Execute(null); Assert.IsNotNull(result); Assert.IsFalse(result.Result); }
public void MoveFileFailsWhenMissingArgumentDestinationPath() { var moveFileAction = new MoveFileAction() { Id = PluginUtilities.GetUniqueId() }; var args = new ArgumentCollection((MoveFileActionExecutionArgs.SourceFilePaths, "")); var result = moveFileAction.Execute(args); Assert.IsNotNull(result); Assert.IsFalse(result.Result); }
public void MoveFileFailsWhenMissingArgumentSourcePath() { var moveFileAction = new MoveFileAction() { Id = PluginUtilities.GetUniqueId(), DestinationDirectory = null }; var result = moveFileAction.Execute(null); Assert.IsNotNull(result); Assert.IsFalse(result.Result); }
public void CreateArgumentMapperInfoTest() { var id = PluginUtilities.GetUniqueId(); string name = "ComponentName"; string description = "This is Component description"; var componentInstance = RoutindoArgumentsMapperInfo.Create <ArgumentMapperMock>(id, name, description); Assert.IsNotNull(componentInstance); Assert.AreEqual(id, componentInstance.Id); Assert.AreEqual(name, componentInstance.Name); Assert.AreEqual(description, componentInstance.Description); Assert.AreEqual(typeof(ArgumentMapperMock), componentInstance.ComponentType); }
public void CreateWatcherInfoTest() { var id = PluginUtilities.GetUniqueId(); string name = "watcherName"; string description = "This is watcher description"; var watcherInstance = RoutindoWatcherInfo.Create <WatcherMock>(id, name, description); Assert.IsNotNull(watcherInstance); Assert.AreEqual(id, watcherInstance.Id); Assert.AreEqual(name, watcherInstance.Name); Assert.AreEqual(description, watcherInstance.Description); Assert.AreEqual(typeof(WatcherMock), watcherInstance.ComponentType); }
public void CreateActionInfoTest() { var id = PluginUtilities.GetUniqueId(); string name = "actionName"; string description = "This is action description"; var actionInstance = RoutindoActionInfo.Create <ActionMock>(id, name, description); Assert.IsNotNull(actionInstance); Assert.AreEqual(id, actionInstance.Id); Assert.AreEqual(name, actionInstance.Name); Assert.AreEqual(description, actionInstance.Description); Assert.AreEqual(typeof(ActionMock), actionInstance.ComponentType); }
public void DownloadFileWithAppendTest() { var localWriteDir = Path.GetDirectoryName(Environment.ExpandEnvironmentVariables(LocalWorkingDir)); FtpDownloadAction ftpDownloadAction = new FtpDownloadAction() { Id = PluginUtilities.GetUniqueId(), LoggingService = ServicesContainer.ServicesProvider.GetLoggingService(nameof(FtpDownloadAction)) }; ftpDownloadAction.Host = FtpTestCredentials.Host; ftpDownloadAction.Username = FtpTestCredentials.User; ftpDownloadAction.Password = FtpTestCredentials.Password; ftpDownloadAction.Port = FtpTestCredentials.Port; ftpDownloadAction.DirectoryPath = LocalDownloadDir; ftpDownloadAction.Append = true; var fileNamePath = CreateTestFile(localWriteDir); var actionResult = ftpDownloadAction.Execute(ArgumentCollection.New() .WithArgument(FtpDownloadActionExecutionArgs.RemoteFilesCollection, new List <string>() { Path.GetFileName(fileNamePath) }) ); Assert.IsNotNull(actionResult); Assert.IsTrue(actionResult.Result); File.AppendAllLines(Path.Combine(Environment.ExpandEnvironmentVariables(localWriteDir), fileNamePath), new List <string>() { // Environment.NewLine, $"{Environment.NewLine}Hello world!" }); actionResult = ftpDownloadAction.Execute(ArgumentCollection.New() .WithArgument(FtpDownloadActionExecutionArgs.RemoteFilesCollection, new List <string>() { Path.GetFileName(fileNamePath) }) ); Assert.IsNotNull(actionResult); Assert.IsTrue(actionResult.Result); var fileLines = File.ReadAllLines(Path.Combine( Environment.ExpandEnvironmentVariables(ftpDownloadAction.DirectoryPath), Path.GetFileName(fileNamePath))); Assert.AreEqual(2, fileLines.Count()); }
public void WatchProcessFailsOnNoNameTest() { IWatcher watcher = new ProcessWatcher() { Id = PluginUtilities.GetUniqueId(), LoggingService = ServicesContainer.ServicesProvider.GetLoggingService(nameof(ProcessWatcher)), }; var watcherResult = watcher.Watch(); Assert.IsNotNull(watcherResult); Assert.IsFalse(watcherResult.Result); Assert.IsNotNull(watcherResult.AttachedException); Assert.AreEqual(typeof(MissingArgumentException), watcherResult.AttachedException.GetType()); }
public void CreateZipFromDirectoryTest() { var outputDirectory = Path.Combine(Path.GetTempPath(), "TEST_OUTPUT"); IAction action = new ZipDirectoryAction() { OutputDirectory = outputDirectory, CreateOutputDirectory = true, EraseOutputIfExists = true, Id = PluginUtilities.GetUniqueId(), LoggingService = ServicesContainer.ServicesProvider.GetLoggingService(null) }; var testDir = Path.Combine(Path.GetTempPath(), "TEMPO_TEST"); if (!Directory.Exists(testDir)) { Directory.CreateDirectory(testDir); } var createdDir = new DirectoryInfo(testDir); Assert.IsTrue(Directory.Exists(createdDir.FullName)); var file1 = Path.Combine(createdDir.FullName, "file1.txt"); if (!File.Exists(file1)) { File.WriteAllText(file1, "Hello world"); } Assert.IsTrue(File.Exists(file1)); var file2 = Path.Combine(createdDir.FullName, "file2.txt"); if (!File.Exists(file2)) { File.WriteAllText(file2, "Hello world"); } Assert.IsTrue(File.Exists(file2)); var actionResult = action.Execute(ArgumentCollection.New() .WithArgument(ZipDirectoryActionExecutionArgs.Directory, createdDir.FullName)); Assert.IsNotNull(actionResult); Assert.IsTrue(actionResult.Result); Assert.IsTrue(File.Exists(Path.Combine(outputDirectory, "TEMPO_TEST.zip"))); Directory.Delete(createdDir.FullName, true); File.Delete(Path.Combine(Path.GetTempPath(), "TEMPO_TEST.zip")); }
public void CreateZipFailsOnSourceDirectoryNotFoundTest() { var outputDirectory = Path.Combine(Path.GetTempPath(), "TEST_OUTPUT"); IAction action = new ZipDirectoryAction() { OutputDirectory = outputDirectory, Id = PluginUtilities.GetUniqueId(), LoggingService = ServicesContainer.ServicesProvider.GetLoggingService(null) }; var testDir = Path.Combine(Path.GetTempPath(), "TEMPO_TEST"); var actionResult = action.Execute(ArgumentCollection.New() .WithArgument(ZipDirectoryActionExecutionArgs.Directory, testDir)); Assert.IsNotNull(actionResult); Assert.IsFalse(actionResult.Result); }
private IWatcher GetPingWatcher(bool anyStatus, string targetHost, bool targetStatus = true) { return(anyStatus ? new PingStatusWatcher() { Id = PluginUtilities.GetUniqueId(), AnyStatus = anyStatus, Host = targetHost } : new PingStatusWatcher() { Id = PluginUtilities.GetUniqueId(), AnyStatus = anyStatus, Host = targetHost, Reachable = targetStatus }); }
public void StartProcessNotepadTest() { string processPath = @"notepad"; StartProcessAction startProcessAction = new StartProcessAction() { Id = PluginUtilities.GetUniqueId(), LoggingService = ServicesContainer.ServicesProvider.GetLoggingService(nameof(StartProcessAction)), ProcessPath = processPath, }; var actionResult = startProcessAction.Execute(ArgumentCollection.New()); Assert.IsNotNull(actionResult); Assert.IsTrue(actionResult.Result); System.Diagnostics.Process.GetProcessesByName(processPath).FirstOrDefault()?.Kill(); }
public void KillProcessByIdNotExistTest() { var processId = int.MaxValue; Assert.AreNotEqual(0, processId); Console.WriteLine($"Created Process with ID {processId}"); Thread.Sleep(1000); KillProcessByIdAction action = new KillProcessByIdAction() { Id = PluginUtilities.GetUniqueId(), LoggingService = ServicesContainer.ServicesProvider.GetLoggingService(nameof(KillProcessByNameAction)) }; var actionResult = action.Execute(ArgumentCollection.New() .WithArgument(KillProcessByIdActionExecutionArgs.ProcessId, processId) ); Assert.IsNotNull(actionResult); Assert.IsFalse(actionResult.Result); Assert.IsNotNull(actionResult.AttachedException); }
public void CheckStatusOfUnavailableUrl() { var watcher = new UrlStatusWatcher() { AnyStatus = true, Url = "http://routindo.com/error404notfound", Id = PluginUtilities.GetUniqueId(), LoggingService = ServicesContainer.ServicesProvider.GetLoggingService(nameof(UrlStatusWatcher)) }; var watcherResult = watcher.Watch(); Assert.IsNotNull(watcherResult); Assert.IsTrue(watcherResult.Result); Assert.IsTrue(watcherResult.WatchingArguments.HasArgument(UrlStatusWatcherResultArgs.StatusCodeName)); Assert.IsInstanceOfType(watcherResult.WatchingArguments[UrlStatusWatcherResultArgs.StatusCodeName], typeof(string)); Assert.IsTrue(watcherResult.WatchingArguments.HasArgument(UrlStatusWatcherResultArgs.StatusCodeValue)); Assert.IsInstanceOfType(watcherResult.WatchingArguments[UrlStatusWatcherResultArgs.StatusCodeValue], typeof(int)); var statusCodeValue = watcherResult.WatchingArguments.GetValue <int>(UrlStatusWatcherResultArgs.StatusCodeValue); var statusCode = (HttpStatusCode)statusCodeValue; Assert.AreEqual(HttpStatusCode.NotFound, statusCode); }
public void WatchForDirectoryTest() { string remoteWorkingDir = "/"; FtpWatcher watcher = new FtpWatcher { Id = PluginUtilities.GetUniqueId(), LoggingService = ServicesContainer.ServicesProvider.GetLoggingService(nameof(FtpWatcher)), Host = FtpTestCredentials.Host, Username = FtpTestCredentials.User, Password = FtpTestCredentials.Password, SelectDirectories = true }; var watcherResult = watcher.Watch(); Assert.IsNotNull(watcherResult); Assert.AreEqual(true, watcherResult.Result); Assert.IsNotNull(watcherResult.WatchingArguments); Assert.IsTrue(watcherResult.WatchingArguments.HasArgument(FtpWatcherResultArgs.RemoteFilesCollection)); Assert.IsTrue(watcherResult.WatchingArguments.GetValue <List <string> >(FtpWatcherResultArgs.RemoteFilesCollection).Any()); Assert.AreEqual(1, watcherResult.WatchingArguments.GetValue <List <string> >(FtpWatcherResultArgs.RemoteFilesCollection).Count); }
public void StartProcessTest() { string processPath = @"%userprofile%\Desktop\processtest\sample.bat"; StartProcessAction startProcessAction = new StartProcessAction() { Id = PluginUtilities.GetUniqueId(), LoggingService = ServicesContainer.ServicesProvider.GetLoggingService(nameof(StartProcessAction)), ProcessPath = Environment.ExpandEnvironmentVariables(processPath), WaitForExit = true, WaitForExitTimeout = 10000 }; var actionResult = startProcessAction.Execute(ArgumentCollection.New()); Assert.IsNotNull(actionResult); Assert.IsTrue(actionResult.Result); Assert.IsNull(actionResult.AttachedException); Assert.IsNotNull(actionResult.AdditionalInformation); Assert.IsTrue(actionResult.AdditionalInformation.HasArgument(StartProcessActionResultArgs.ProcessPath)); Assert.IsTrue( actionResult.AdditionalInformation.HasArgument(StartProcessActionResultArgs.ProcessArguments)); Assert.IsTrue( actionResult.AdditionalInformation.HasArgument(StartProcessActionResultArgs.ProcessWorkingDirectory)); Assert.IsTrue(actionResult.AdditionalInformation.HasArgument(StartProcessActionResultArgs.ProcessExited)); Assert.IsTrue(actionResult.AdditionalInformation.HasArgument(StartProcessActionResultArgs.ProcessStarted)); Assert.AreEqual(Environment.ExpandEnvironmentVariables(processPath), actionResult.AdditionalInformation.GetValue <string>(StartProcessActionResultArgs.ProcessPath)); Assert.AreEqual(Path.GetDirectoryName(Environment.ExpandEnvironmentVariables(processPath)), actionResult.AdditionalInformation.GetValue <string>( StartProcessActionResultArgs.ProcessWorkingDirectory)); Assert.IsTrue(string.IsNullOrWhiteSpace( actionResult.AdditionalInformation.GetValue <string>(StartProcessActionResultArgs.ProcessArguments))); Assert.AreEqual(true, actionResult.AdditionalInformation.GetValue <bool>(StartProcessActionResultArgs.ProcessStarted)); Assert.AreEqual(true, actionResult.AdditionalInformation.GetValue <bool>(StartProcessActionResultArgs.ProcessExited)); }