35 instantiations of CommandViewModel
Aspire.Dashboard (1)
ServiceClient\Partials.cs (1)
135.Select(c => new CommandViewModel(c.Name, MapState(c.State), c.DisplayName, c.DisplayDescription, c.ConfirmationMessage, c.ArgumentInputs.ToImmutableArray(), c.IsHighlighted, c.IconName, MapIconVariant(c.IconVariant)))
Aspire.Dashboard.Components.Tests (24)
Controls\MissingParametersPanelTests.cs (1)
141new(CommandViewModel.SetParameterCommand, CommandViewModelState.Enabled, "Set", string.Empty, string.Empty, [input], isHighlighted: false, iconName: string.Empty, iconVariant: Microsoft.FluentUI.AspNetCore.Components.IconVariant.Regular);
Controls\ResourceDetailsTests.cs (3)
797var setCommand = new CommandViewModel( 843var setCommand = new CommandViewModel( 889var setCommand = new CommandViewModel(
Controls\TerminalDisconnectedBannerTests.cs (1)
206new(name, state, name, string.Empty, string.Empty, [], false, "ArrowClockwise", IconVariant.Regular);
Controls\TerminalViewTests.cs (1)
624commands: [new CommandViewModel(CommandViewModel.StartCommand, CommandViewModelState.Enabled,
Layout\ResourcesLayoutTests.cs (13)
636static CommandViewModel Command(string name, CommandViewModelState state) => new(name, state, name, "", 1544var command = new CommandViewModel("resource-stop", CommandViewModelState.Enabled, "Stop", "Stop resource", confirmationMessage: "", argumentInputs: [], isHighlighted: true, iconName: iconName, iconVariant: IconVariant.Filled); 1586var stop = new CommandViewModel("resource-stop", CommandViewModelState.Enabled, "Stop", "Stop resource", confirmationMessage: "", argumentInputs: [], isHighlighted: true, iconName: "Stop", iconVariant: IconVariant.Filled); 1587var other = new CommandViewModel("custom", CommandViewModelState.Enabled, "Custom command", "", confirmationMessage: "", argumentInputs: [], isHighlighted: false, iconName: string.Empty, iconVariant: IconVariant.Regular); 1617new(CommandViewModel.StopCommand, state, "Stop", "", confirmationMessage: "", argumentInputs: [], isHighlighted: true, iconName: "", iconVariant: IconVariant.Regular); 1626new CommandViewModel(CommandViewModel.SetParameterCommand, CommandViewModelState.Enabled, "Set parameter", "", 1673var command = new CommandViewModel("refresh", CommandViewModelState.Enabled, "Refresh", "", 1712var stop = new CommandViewModel("resource-stop", CommandViewModelState.Enabled, "Stop", "Stop resource", confirmationMessage: "", argumentInputs: [], isHighlighted: true, iconName: "Stop", iconVariant: IconVariant.Filled); 1747new(name, state, name, "", confirmationMessage: "", argumentInputs: [], isHighlighted: highlighted, iconName: "", iconVariant: IconVariant.Regular); 1784new(name, state, name, "", confirmationMessage: "", argumentInputs: [], isHighlighted: highlighted, iconName: "", iconVariant: IconVariant.Regular); 1835new(name, state, displayName, "", confirmationMessage: "", argumentInputs: [], isHighlighted: highlighted, iconName: "Key", iconVariant: IconVariant.Regular); 1891new(name, state, name, "", confirmationMessage: "", argumentInputs: [], isHighlighted: true, iconName: "", iconVariant: IconVariant.Regular); 2012var stop = new CommandViewModel("resource-stop", CommandViewModelState.Enabled, "Stop", "Stop resource", confirmationMessage: "", argumentInputs: [], isHighlighted: true, iconName: "Stop", iconVariant: IconVariant.Filled);
Model\DashboardCommandExecutorTests.cs (1)
79var command = new CommandViewModel(
Pages\ConsoleLogsTests.cs (3)
839commands: [new CommandViewModel("test-name", CommandViewModelState.Enabled, "test-displayname", "test-displaydescription", confirmationMessage: "", argumentInputs: [], isHighlighted: true, iconName: string.Empty, iconVariant: IconVariant.Regular)]); 904new CommandViewModel( 948commands: [new CommandViewModel("test-name", CommandViewModelState.Enabled, "test-displayname", "test-displaydescription", confirmationMessage: "", argumentInputs: [], isHighlighted: true, iconName: string.Empty, iconVariant: IconVariant.Regular)]);
Pages\ResourcesTests.cs (1)
275new CommandViewModel(
Aspire.Dashboard.Playwright.Tests (2)
Integration\Playwright\ResourcePaneResponsiveTests.cs (2)
264commands: [new("inspect", CommandViewModelState.Enabled, "Inspect", "", "", [], 2847new(name, CommandViewModelState.Enabled, name, "", confirmationMessage: "", argumentInputs: [],
Aspire.Dashboard.Tests (8)
Model\DashboardClientTests.cs (1)
1509return new CommandViewModel(
Model\DashboardCommandExecutorTests.cs (1)
431return new CommandViewModel(
Model\ResourceMenuBuilderTests.cs (6)
161new(name, state, name, "", "", [], false, "", IconVariant.Regular); 409var startCommand = new CommandViewModel( 419var stopCommand = new CommandViewModel( 457var command = new CommandViewModel( 502var command = new CommandViewModel( 545var command = new CommandViewModel(
213 references to CommandViewModel
Aspire.Dashboard (90)
Components\Controls\ApplicationSummary.razor.cs (2)
623private Task ExecuteCommandAsync(ResourceViewModel resource, CommandViewModel command) => 651EventCallback.Factory.Create<CommandViewModel>(this, command => ExecuteCommandAsync(resource, command)),
Components\Controls\MissingParametersPanel.razor.cs (7)
51public required Func<ResourceViewModel, CommandViewModel, Task> OnExecuteCommandAsync { get; set; } 54public required Func<ResourceViewModel, CommandViewModel, ExecuteResourceCommandOptions, Task> OnExecuteCommandWithOptionsAsync { get; set; } 57public required Func<ResourceViewModel, CommandViewModel, bool> IsCommandExecuting { get; set; } 117private static CommandViewModel? GetSetParameterCommand(ResourceViewModel parameter) => 119string.Equals(command.Name, CommandViewModel.SetParameterCommand, StringComparisons.CommandName) && 135var command = GetSetParameterCommand(parameter); 367CommandViewModel Command,
Components\Controls\ParameterOverview.razor.cs (7)
38public required Func<ResourceViewModel, CommandViewModel, Task> OnExecuteCommandAsync { get; set; } 41public required Func<ResourceViewModel, CommandViewModel, ExecuteResourceCommandOptions, Task> OnExecuteCommandWithOptionsAsync { get; set; } 44public required Func<ResourceViewModel, CommandViewModel, bool> IsCommandExecuting { get; set; } 49private CommandViewModel? SetCommand { get; set; } 50private CommandViewModel? DeleteCommand { get; set; } 83string.Equals(command.Name, CommandViewModel.SetParameterCommand, StringComparisons.CommandName) && 87string.Equals(command.Name, CommandViewModel.DeleteParameterCommand, StringComparisons.CommandName) &&
Components\Controls\ResourceActions.razor.cs (3)
29public required EventCallback<CommandViewModel> CommandSelected { get; set; } 32public required Func<ResourceViewModel, CommandViewModel, bool> IsCommandExecuting { get; set; } 49private readonly List<CommandViewModel> _highlightedCommands = new();
Components\Controls\ResourceDetails.razor.cs (4)
41public required EventCallback<CommandViewModel> CommandSelected { get; set; } 44public required Func<ResourceViewModel, CommandViewModel, bool> IsCommandExecuting { get; set; } 221["OnExecuteCommandAsync"] = (Func<ResourceViewModel, CommandViewModel, Task>)ExecuteResourceCommandAsync, 311private async Task ExecuteResourceCommandAsync(ResourceViewModel resource, CommandViewModel command)
Components\Controls\TerminalDisconnectedBanner.razor.cs (4)
82private CommandViewModel? RestartCommand 94c.Name is CommandViewModel.RestartCommand or CommandViewModel.StartCommand); 96.ThenBy(c => c.Name != CommandViewModel.RestartCommand).FirstOrDefault();
Components\Layout\ResourcesLayout.razor.cs (15)
1865private static IEnumerable<CommandViewModel> GetHighlightedCommands(ResourceViewModel resource) => resource.Commands 1869private static IEnumerable<CommandViewModel> GetFullPageRowCommands(ResourceViewModel resource) => 1872string.Equals(c.Name, CommandViewModel.SetParameterCommand, StringComparisons.CommandName) && 1876private static IEnumerable<CommandViewModel> GetResourceRowCommands(ResourceViewModel resource) 1880KnownResourceState.Running => [CommandViewModel.StopCommand, CommandViewModel.RestartCommand], 1882[CommandViewModel.StartCommand], 1892private static IEnumerable<CommandViewModel> GetSidebarCommands(ResourceViewModel resource) 1898c.Name is not (CommandViewModel.StartCommand or CommandViewModel.StopCommand or CommandViewModel.RestartCommand)) 1958private bool IsCommandDisabled(ResourceViewModel resource, CommandViewModel command) => 1989EventCallback.Factory.Create<CommandViewModel>(this, command => ExecuteResourceCommandAsync(resource, command)), 2049private Task ExecuteResourceCommandAsync(ResourceViewModel resource, CommandViewModel command) 2052string.Equals(command.Name, CommandViewModel.SetParameterCommand, StringComparisons.CommandName))
Components\Legacy\Pages\ConsoleLogs.razor.cs (3)
165private readonly List<CommandViewModel> _highlightedCommands = new(); 585EventCallback.Factory.Create<CommandViewModel>(this, ExecuteResourceCommandAsync), 626private async Task ExecuteResourceCommandAsync(CommandViewModel command)
Components\Legacy\Pages\Resources.razor.cs (3)
628foreach (var command in resource.Commands) 722EventCallback.Factory.Create<CommandViewModel>(this, (command) => ExecuteResourceCommandAsync(resource, command)), 856private async Task ExecuteResourceCommandAsync(ResourceViewModel resource, CommandViewModel command)
Components\Legacy\Pages\Terminals.razor.cs (3)
24private readonly List<CommandViewModel> _highlightedCommands = []; 264EventCallback.Factory.Create<CommandViewModel>(this, ExecuteResourceCommandAsync), 270private Task ExecuteResourceCommandAsync(CommandViewModel command)
Components\Pages\ConsoleLogs.razor.cs (3)
187private readonly List<CommandViewModel> _highlightedCommands = new(); 689EventCallback.Factory.Create<CommandViewModel>(this, ExecuteResourceCommandAsync), 730private async Task ExecuteResourceCommandAsync(CommandViewModel command)
Components\Pages\ResourceOverview.Details.cs (2)
124["OnExecuteCommandAsync"] = (Func<ResourceViewModel, CommandViewModel, Task>)ExecuteResourceCommandAsync, 125["IsCommandExecuting"] = (Func<ResourceViewModel, CommandViewModel, bool>)((r, command) => DashboardCommandExecutor.IsExecuting(r.Name, command.Name)),
Components\Pages\ResourceOverview.razor.cs (2)
724private Task ExecuteResourceCommandAsync(ResourceViewModel resource, CommandViewModel command) 727private Task ExecuteResourceCommandAsync(ResourceViewModel resource, CommandViewModel command, ExecuteResourceCommandOptions options)
Components\Pages\Resources.razor.cs (3)
653foreach (var command in resource.Commands) 778EventCallback.Factory.Create<CommandViewModel>(this, (command) => ExecuteResourceCommandAsync(resource, command)), 919private async Task ExecuteResourceCommandAsync(ResourceViewModel resource, CommandViewModel command)
Components\Pages\Terminals.razor.cs (3)
24private readonly List<CommandViewModel> _highlightedCommands = []; 294EventCallback.Factory.Create<CommandViewModel>(this, ExecuteResourceCommandAsync), 300private Task ExecuteResourceCommandAsync(CommandViewModel command)
Model\DashboardCommandExecutor.cs (7)
54if (dashboardClient.IsReadOnly || commandName is not (CommandViewModel.StopCommand or CommandViewModel.StartCommand)) 61var command = resource.Commands.FirstOrDefault(c => string.Equals(c.Name, commandName, StringComparisons.CommandName)); 76CommandViewModel command, 130CommandViewModel command, 386private static NotificationAction CreateViewResponseNotificationAction(IStringLocalizer<Dashboard.Resources.Resources> loc, CommandViewModel command, ResourceCommandResponseViewModel response) 401private static async Task OpenViewResponseDialogAsync(DashboardDialogService dialogService, CommandViewModel command, ResourceCommandResponseViewModel response)
Model\ResourceMenuBuilder.cs (13)
72EventCallback<CommandViewModel> commandSelected, 73Func<ResourceViewModel, CommandViewModel, bool> isCommandExecuting, 295Func<ResourceViewModel, CommandViewModel, bool> isCommandExecuting, 296Func<ResourceViewModel, CommandViewModel, Task> executeCommand) 340bool CanExecute(ResourceViewModel resource, CommandViewModel command) => 348var command = resource.Commands.FirstOrDefault(c => string.Equals(c.Name, commandName, StringComparisons.CommandName)); 357private void AddCommandMenuItems(List<MenuButtonItem> menuItems, ResourceViewModel resource, EventCallback<CommandViewModel> commandSelected, Func<ResourceViewModel, CommandViewModel, bool> isCommandExecuting) 374foreach (var highlightedCommand in highlightedMenuCommands) 385foreach (var command in otherMenuCommands) 400foreach (var command in otherMenuCommands) 406MenuButtonItem CreateMenuItem(CommandViewModel command) => CreateCommandMenuItem( 412private MenuButtonItem CreateCommandMenuItem(CommandViewModel command, Func<Task> onClick, bool isDisabled) => new()
Model\ResourceViewModel.cs (1)
47public required ImmutableArray<CommandViewModel> Commands { get; init; }
ServiceClient\DashboardClient.cs (1)
1091public async Task<ResourceCommandResponseViewModel> ExecuteResourceCommandAsync(string resourceName, string resourceType, CommandViewModel command, ExecuteResourceCommandOptions options, CancellationToken cancellationToken)
ServiceClient\IDashboardClient.cs (1)
75Task<ResourceCommandResponseViewModel> ExecuteResourceCommandAsync(string resourceName, string resourceType, CommandViewModel command, ExecuteResourceCommandOptions options, CancellationToken cancellationToken);
ServiceClient\Partials.cs (1)
132ImmutableArray<CommandViewModel> GetCommands()
ServiceClient\SelectedDashboardClient.cs (1)
66public Task<ResourceCommandResponseViewModel> ExecuteResourceCommandAsync(string resourceName, string resourceType, CommandViewModel command, ExecuteResourceCommandOptions options, CancellationToken cancellationToken)
Telemetry\TelemetryPropertyValues.cs (1)
15return CommandViewModel.IsKnownCommand(commandName)
Aspire.Dashboard.Components.Tests (67)
Controls\MissingParametersPanelTests.cs (7)
52var command = CreateSetCommand(input); 54CommandViewModel? executed = null; 140private static CommandViewModel CreateSetCommand(InteractionInput input) => 141new(CommandViewModel.SetParameterCommand, CommandViewModelState.Enabled, "Set", string.Empty, string.Empty, [input], isHighlighted: false, iconName: string.Empty, iconVariant: Microsoft.FluentUI.AspNetCore.Components.IconVariant.Regular); 143private static ResourceViewModel CreateParameter(CommandViewModel command) => 146private IRenderedComponent<MissingParametersPanel> RenderPanel(ResourceViewModel parameter, bool isReadOnly, Func<ResourceViewModel, CommandViewModel, Task>? executeCommand = null) => 149private IRenderedComponent<MissingParametersPanel> RenderPanel(ResourceViewModel[] parameters, bool isReadOnly, Func<ResourceViewModel, CommandViewModel, Task>? executeCommand = null)
Controls\ResourceActionsTests.cs (1)
142.Add(component => component.CommandSelected, EventCallback<CommandViewModel>.Empty)
Controls\ResourceDetailsTests.cs (14)
797var setCommand = new CommandViewModel( 798CommandViewModel.SetParameterCommand, 820CommandViewModel? capturedCommand = null; 825builder.Add(p => p.CommandSelected, EventCallback.Factory.Create<CommandViewModel>(this, c => capturedCommand = c)); 835Assert.Equal(CommandViewModel.SetParameterCommand, capturedCommand!.Name); 843var setCommand = new CommandViewModel( 844CommandViewModel.SetParameterCommand, 866CommandViewModel? capturedCommand = null; 871builder.Add(p => p.CommandSelected, EventCallback.Factory.Create<CommandViewModel>(this, c => capturedCommand = c)); 873currentResource.Name == resource.Name && command.Name == CommandViewModel.SetParameterCommand); 889var setCommand = new CommandViewModel( 890CommandViewModel.SetParameterCommand, 916builder.Add(p => p.CommandSelected, EventCallback.Factory.Create<CommandViewModel>(this, _ => Task.CompletedTask)); 983ImmutableArray<CommandViewModel>? commands = null)
Controls\TerminalDisconnectedBannerTests.cs (13)
56[InlineData(CommandViewModel.StartCommand, ResourceCommandResponseKind.Succeeded)] 57[InlineData(CommandViewModel.RestartCommand, ResourceCommandResponseKind.Succeeded)] 58[InlineData(CommandViewModel.StartCommand, ResourceCommandResponseKind.Failed)] 59[InlineData(CommandViewModel.RestartCommand, ResourceCommandResponseKind.Cancelled)] 107displayName: "shell", commands: [CreateCommand(CommandViewModel.RestartCommand)]); 119commands: [CreateCommand(CommandViewModel.RestartCommand)], state: KnownResourceState.Finished, properties: new() 134toasts.WaitForAssertion(() => Assert.Equal($"shell \"{CommandViewModel.RestartCommand}\" succeeded", 145commands: [CreateCommand(CommandViewModel.RestartCommand)]); 161[CreateCommand(CommandViewModel.RestartCommand, CommandViewModelState.Hidden)]); 169commands: [CreateCommand(CommandViewModel.RestartCommand, CommandViewModelState.Disabled)]))]); 173commands: [CreateCommand(CommandViewModel.RestartCommand, CommandViewModelState.Disabled), 174CreateCommand(CommandViewModel.StartCommand)]))]); 205private static CommandViewModel CreateCommand(string name, CommandViewModelState state = CommandViewModelState.Enabled) =>
Controls\TerminalViewTests.cs (1)
624commands: [new CommandViewModel(CommandViewModel.StartCommand, CommandViewModelState.Enabled,
Layout\ResourcesLayoutTests.cs (24)
636static CommandViewModel Command(string name, CommandViewModelState state) => new(name, state, name, "", 1544var command = new CommandViewModel("resource-stop", CommandViewModelState.Enabled, "Stop", "Stop resource", confirmationMessage: "", argumentInputs: [], isHighlighted: true, iconName: iconName, iconVariant: IconVariant.Filled); 1564.Add(component => component.CommandSelected, EventCallback<CommandViewModel>.Empty) 1586var stop = new CommandViewModel("resource-stop", CommandViewModelState.Enabled, "Stop", "Stop resource", confirmationMessage: "", argumentInputs: [], isHighlighted: true, iconName: "Stop", iconVariant: IconVariant.Filled); 1587var other = new CommandViewModel("custom", CommandViewModelState.Enabled, "Custom command", "", confirmationMessage: "", argumentInputs: [], isHighlighted: false, iconName: string.Empty, iconVariant: IconVariant.Regular); 1616static CommandViewModel Stop(CommandViewModelState state) => 1617new(CommandViewModel.StopCommand, state, "Stop", "", confirmationMessage: "", argumentInputs: [], isHighlighted: true, iconName: "", iconVariant: IconVariant.Regular); 1618var enabled = Stop(CommandViewModelState.Enabled); 1626new CommandViewModel(CommandViewModel.SetParameterCommand, CommandViewModelState.Enabled, "Set parameter", "", 1673var command = new CommandViewModel("refresh", CommandViewModelState.Enabled, "Refresh", "", 1712var stop = new CommandViewModel("resource-stop", CommandViewModelState.Enabled, "Stop", "Stop resource", confirmationMessage: "", argumentInputs: [], isHighlighted: true, iconName: "Stop", iconVariant: IconVariant.Filled); 1746static CommandViewModel Command(string name, CommandViewModelState state, bool highlighted) => 1751Command(CommandViewModel.StartCommand, CommandViewModelState.Hidden, false), 1752Command(CommandViewModel.StopCommand, CommandViewModelState.Enabled, true), 1753Command(CommandViewModel.RestartCommand, CommandViewModelState.Enabled, false) 1783static CommandViewModel Command(string name, CommandViewModelState state, bool highlighted) => 1790Command(CommandViewModel.StopCommand, CommandViewModelState.Enabled, false), 1834static CommandViewModel Command(string name, string displayName, CommandViewModelState state, bool highlighted) => 1836var commands = new List<CommandViewModel> 1839Command(CommandViewModel.DeleteParameterCommand, "Delete parameter", CommandViewModelState.Enabled, true) 1843commands.Add(Command(CommandViewModel.SetParameterCommand, "Set parameter", state, highlighted)); 1890static CommandViewModel Command(string name, CommandViewModelState state) => 1895Command(CommandViewModel.StopCommand, CommandViewModelState.Enabled), 2012var stop = new CommandViewModel("resource-stop", CommandViewModelState.Enabled, "Stop", "Stop resource", confirmationMessage: "", argumentInputs: [], isHighlighted: true, iconName: "Stop", iconVariant: IconVariant.Filled);
Model\DashboardCommandExecutorTests.cs (1)
79var command = new CommandViewModel(
Pages\ResourcesTests.cs (2)
296builder.Add(component => component.CommandSelected, EventCallback.Factory.Create<CommandViewModel>(this, _ => Task.CompletedTask)); 297builder.Add(component => component.IsCommandExecuting, (ResourceViewModel _, CommandViewModel _) => false);
tests\Shared\DashboardModel\ModelTestHelpers.cs (1)
24ImmutableArray<CommandViewModel>? commands = null,
tests\Shared\TestDashboardClient.cs (3)
25private readonly Func<string, string, CommandViewModel, ExecuteResourceCommandOptions, CancellationToken, Task<ResourceCommandResponseViewModel>>? _executeResourceCommand; 65Func<string, string, CommandViewModel, ExecuteResourceCommandOptions, CancellationToken, Task<ResourceCommandResponseViewModel>>? executeResourceCommand = null, 103public Task<ResourceCommandResponseViewModel> ExecuteResourceCommandAsync(string resourceName, string resourceType, CommandViewModel command, ExecuteResourceCommandOptions options, CancellationToken cancellationToken)
Aspire.Dashboard.Playwright.Tests (7)
Integration\Playwright\ResourcePaneResponsiveTests.cs (2)
2841name == "service-key" ? [Command(CommandViewModel.SetParameterCommand)] : [], 2846private static CommandViewModel Command(string name) =>
tests\Aspire.Dashboard.Tests\Shared\MockDashboardClient.cs (1)
62public Task<ResourceCommandResponseViewModel> ExecuteResourceCommandAsync(string resourceName, string resourceType, CommandViewModel command, ExecuteResourceCommandOptions options, CancellationToken cancellationToken) => throw new NotImplementedException();
tests\Shared\DashboardModel\ModelTestHelpers.cs (1)
24ImmutableArray<CommandViewModel>? commands = null,
tests\Shared\TestDashboardClient.cs (3)
25private readonly Func<string, string, CommandViewModel, ExecuteResourceCommandOptions, CancellationToken, Task<ResourceCommandResponseViewModel>>? _executeResourceCommand; 65Func<string, string, CommandViewModel, ExecuteResourceCommandOptions, CancellationToken, Task<ResourceCommandResponseViewModel>>? executeResourceCommand = null, 103public Task<ResourceCommandResponseViewModel> ExecuteResourceCommandAsync(string resourceName, string resourceType, CommandViewModel command, ExecuteResourceCommandOptions options, CancellationToken cancellationToken)
Aspire.Dashboard.Tests (49)
Model\DashboardClientTests.cs (1)
1507private static CommandViewModel CreateCommand()
Model\DashboardCommandExecutorTests.cs (20)
37var command = CreateCommand(); 45[InlineData(CommandViewModel.StopCommand, true)] 46[InlineData(CommandViewModel.StartCommand, true)] 47[InlineData(CommandViewModel.RestartCommand, false)] 73var resource = ModelTestHelpers.CreateResource(resourceName: "api", commands: [CreateCommand(CommandViewModel.StopCommand)]); 75Assert.False(await executor.ExecuteGraphGameCommandAsync(resource, CommandViewModel.StopCommand, r => r.DisplayName)); 84var resource = ModelTestHelpers.CreateResource(resourceName: "api", commands: [CreateCommand(CommandViewModel.StopCommand)]); 86Assert.False(await executor.ExecuteGraphGameCommandAsync(resource, CommandViewModel.StopCommand, r => r.DisplayName)); 103var resource = ModelTestHelpers.CreateResource(resourceName: "api", commands: [CreateCommand(CommandViewModel.StopCommand, state, confirmationMessage)]); 105Assert.Null(await executor.ExecuteGraphGameCommandAsync(resource, CommandViewModel.StopCommand, r => r.DisplayName)); 123var resource = ModelTestHelpers.CreateResource(resourceName: "api", commands: [CreateCommand(CommandViewModel.StopCommand)]); 125Assert.Null(await executor.ExecuteGraphGameCommandAsync(resource, CommandViewModel.StopCommand, r => r.DisplayName)); 136Assert.Null(await executor.ExecuteGraphGameCommandAsync(resource, CommandViewModel.StopCommand, r => r.DisplayName)); 145var command = CreateCommand(); 173var command = CreateCommand(); 225var command = CreateCommand(); 269var command = CreateCommand(); 309var command = CreateCommand(); 353var command = CreateCommand(); 429private static CommandViewModel CreateCommand(string name = "test-command", CommandViewModelState state = CommandViewModelState.Enabled, string confirmationMessage = "")
Model\ResourceMenuBuilderTests.cs (20)
103var executed = new List<(string ResourceName, CommandViewModel Command)>(); 160private static CommandViewModel CreateCommand(string name, CommandViewModelState state) => 179EventCallback<CommandViewModel>.Empty, 231EventCallback<CommandViewModel>.Empty, 266EventCallback<CommandViewModel>.Empty, 319EventCallback<CommandViewModel>.Empty, 357EventCallback<CommandViewModel>.Empty, 392EventCallback<CommandViewModel>.Empty, 409var startCommand = new CommandViewModel( 410CommandViewModel.StartCommand, 419var stopCommand = new CommandViewModel( 420CommandViewModel.StopCommand, 440EventCallback<CommandViewModel>.Empty, 457var command = new CommandViewModel( 458CommandViewModel.StartCommand, 480EventCallback<CommandViewModel>.Empty, 502var command = new CommandViewModel( 523EventCallback<CommandViewModel>.Empty, 545var command = new CommandViewModel( 566EventCallback<CommandViewModel>.Empty,
Model\SqliteResourceRepositoryTests.cs (1)
483var command = Assert.Single(actual.Commands);
ResourceOutgoingPeerResolverTests.cs (1)
696public Task<ResourceCommandResponseViewModel> ExecuteResourceCommandAsync(string resourceName, string resourceType, CommandViewModel command, ExecuteResourceCommandOptions options, CancellationToken cancellationToken) => throw new NotImplementedException();
Shared\MockDashboardClient.cs (1)
62public Task<ResourceCommandResponseViewModel> ExecuteResourceCommandAsync(string resourceName, string resourceType, CommandViewModel command, ExecuteResourceCommandOptions options, CancellationToken cancellationToken) => throw new NotImplementedException();
Terminal\DefaultTerminalConnectionResolverTests.cs (1)
196public Task<ResourceCommandResponseViewModel> ExecuteResourceCommandAsync(string resourceName, string resourceType, CommandViewModel command, ExecuteResourceCommandOptions options, CancellationToken cancellationToken) => throw new NotImplementedException();
tests\Shared\DashboardModel\ModelTestHelpers.cs (1)
24ImmutableArray<CommandViewModel>? commands = null,
tests\Shared\TestDashboardClient.cs (3)
25private readonly Func<string, string, CommandViewModel, ExecuteResourceCommandOptions, CancellationToken, Task<ResourceCommandResponseViewModel>>? _executeResourceCommand; 65Func<string, string, CommandViewModel, ExecuteResourceCommandOptions, CancellationToken, Task<ResourceCommandResponseViewModel>>? executeResourceCommand = null, 103public Task<ResourceCommandResponseViewModel> ExecuteResourceCommandAsync(string resourceName, string resourceType, CommandViewModel command, ExecuteResourceCommandOptions options, CancellationToken cancellationToken)