Ejemplo n.º 1
0
        private async Task CheckSingleNodeCommandStatusAsync(IAsyncCommandGroupHandler cmd, int id, IImmutableSet <IProjectTree> nodes1, IImmutableSet <IProjectTree> nodes2)
        {
            var csr = await cmd.GetCommandStatusAsync(nodes1, 0, false, string.Empty, CommandStatus.Enabled);

            csr.Should().Be(CommandStatusResult.Unhandled);

            csr = await cmd.GetCommandStatusAsync(nodes1, id, false, string.Empty, CommandStatus.Enabled);

            csr.Status.Should().Be(CommandStatus.Enabled | CommandStatus.Supported);

            csr = await cmd.GetCommandStatusAsync(nodes2, id, false, string.Empty, CommandStatus.Enabled);

            csr.Should().Be(CommandStatusResult.Unhandled);

            bool result = await cmd.TryHandleCommandAsync(nodes1, id, false, 0, IntPtr.Zero, IntPtr.Zero);

            result.Should().BeTrue();
        }
Ejemplo n.º 2
0
        private async Task CheckSingleNodeCommandStatusAsync(IAsyncCommandGroupHandler cmd, int id, IImmutableSet<IProjectTree> nodes1, IImmutableSet<IProjectTree> nodes2) {
            var csr = await cmd.GetCommandStatusAsync(nodes1, 0, false, string.Empty, CommandStatus.Enabled);
            csr.Should().Be(CommandStatusResult.Unhandled);

            csr = await cmd.GetCommandStatusAsync(nodes1, id, false, string.Empty, CommandStatus.Enabled);
            csr.Status.Should().Be(CommandStatus.Enabled | CommandStatus.Supported);

            csr = await cmd.GetCommandStatusAsync(nodes2, id, false, string.Empty, CommandStatus.Enabled);
            csr.Should().Be(CommandStatusResult.Unhandled);

            bool result = await cmd.TryHandleCommandAsync(nodes1, id, false, 0, IntPtr.Zero, IntPtr.Zero);
            result.Should().BeTrue();
        }