public async Task EditProjectFileCommand_NonRootNode_ShouldntHandle()
        {
            var tree = ProjectTreeParser.Parse(@"
Root (flags: {ProjectRoot})
    Properties ()
");

            var unconfiguredProject = UnconfiguredProjectFactory.Create(filePath: @"C:\Temp\Root\Root.proj");

            var nodes = ImmutableHashSet.Create(tree.Children[0]);

            var command = new EditProjectFileCommand(unconfiguredProject, IProjectFileEditorPresenterFactory.CreateLazy());

            var result = await command.GetCommandStatusAsync(nodes, CommandId, true, "", 0);

            Assert.False(result.Handled);
            Assert.Equal(CommandStatus.NotSupported, result.Status);
        }
        public async Task EditProjectFileCommand_CorrectNode_CallsOpenAsync()
        {
            var tree = ProjectTreeParser.Parse(@"
Root (flags: {ProjectRoot})
");

            var nodes = ImmutableHashSet.Create(tree);

            var unconfiguredProject = UnconfiguredProjectFactory.Create(filePath: @"C:\Temp\Root\Root.proj");
            var editorStateModel    = IProjectFileEditorPresenterFactory.Create();

            var command = new EditProjectFileCommand(unconfiguredProject, new Lazy <IProjectFileEditorPresenter>(() => editorStateModel));

            var result = await command.TryHandleCommandAsync(nodes, CommandId, true, 0, IntPtr.Zero, IntPtr.Zero);

            Assert.True(result);
            Mock.Get(editorStateModel).Verify(e => e.OpenEditorAsync(), Times.Once);
        }
        public async Task EditProjectFileCommand_ValidNode_ShouldHandle()
        {
            var tree = ProjectTreeParser.Parse(@"
Root (flags: {ProjectRoot})
");

            var nodes = ImmutableHashSet.Create(tree);

            var unconfiguredProject = UnconfiguredProjectFactory.Create(filePath: @"C:\Temp\Root\Root.proj");

            var command = new EditProjectFileCommand(unconfiguredProject, IProjectFileEditorPresenterFactory.CreateLazy());

            var result = await command.GetCommandStatusAsync(nodes, CommandId, true, "", 0);

            Assert.True(result.Handled);
            Assert.Equal(CommandStatus.Enabled | CommandStatus.Supported, result.Status);
            Assert.Equal(string.Format(VSResources.EditProjectFileCommand, $"Root.{Extension}"), result.CommandText);
        }