public void RunCommand_CustomCommandSsh() { var sshService = new Mock <ISshService>(); var messageBoxService = new Mock <IMessageBoxService>(); var obj = new CustomCommandListPageViewModel(sshService.Object, messageBoxService.Object); Assert.IsNotNull(obj); Assert.IsNotNull(obj.ClearCommand); Assert.IsNotNull(obj.ExecuteCommand); Assert.IsNotNull(obj.RunCommand); Assert.IsNull(obj.ShellBox); Assert.IsTrue(obj.RunCommand.CanExecute(null)); var cmd = new CustomCommandSsh { CommandString = "ls -la" }; Assert.ThrowsException <NullReferenceException>(() => { obj.RunCommand.Execute(cmd); }); }
public async Task UpdateCustomCommandAsync(CustomCommandSsh customCommandSsh) { await UpdateItemAsync(customCommandSsh).ConfigureAwait(false); }
public CustomCommandSshWrapper(CustomCommandSsh command) { var commandStringEscaped = Uri.EscapeDataString(command.CommandString); _str = $"IdQuery={command.Id}&NameQuery={command.Name}&CommandStringQuery={commandStringEscaped}"; }
public Task <int> InsertCustomCommandAsync(CustomCommandSsh customCommandSsh) { return(InsertItemAsync(customCommandSsh)); }