Exemplo n.º 1
0
        private void CheckSingleNodeCommandStatus(ICommandGroupHandler cmd, int id, IImmutableSet <IProjectTree> nodes1, IImmutableSet <IProjectTree> nodes2)
        {
            var csr = cmd.GetCommandStatus(nodes1, 0, false, string.Empty, CommandStatus.Enabled);

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

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

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

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

            result.Should().BeTrue();
        }
Exemplo n.º 2
0
        private void CheckSingleNodeCommandStatus(ICommandGroupHandler cmd, int id, IImmutableSet<IProjectTree> nodes1, IImmutableSet<IProjectTree> nodes2) {
            var csr = cmd.GetCommandStatus(nodes1, 0, false, string.Empty, CommandStatus.Enabled);
            csr.Should().Be(CommandStatusResult.Unhandled);

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

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

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