public void ProjectSonarLintMenuCommand_QueryStatus_NoProjects_IsDisableIsHidden() { // Setup OleMenuCommand command = CommandHelper.CreateRandomOleMenuCommand(); var testSubject = new ProjectSonarLintMenuCommand(serviceProvider); // Act testSubject.QueryStatus(command, null); // Verify Assert.IsFalse(command.Enabled, "Expected command to be disabled"); Assert.IsFalse(command.Visible, "Expected command to be hidden"); }
public void ProjectSonarLintMenuCommand_QueryStatus_HasUnsupportedProject_IsDisabledIsHidden() { // Setup OleMenuCommand command = CommandHelper.CreateRandomOleMenuCommand(); var testSubject = new ProjectSonarLintMenuCommand(serviceProvider); var p1 = new ProjectMock("cs.proj"); p1.SetCSProjectKind(); var p2 = new ProjectMock("cpp.proj"); this.projectSystem.SelectedProjects = new[] { p1, p2 }; // Act testSubject.QueryStatus(command, null); // Verify Assert.IsFalse(command.Enabled, "Expected command to be disabled"); Assert.IsFalse(command.Visible, "Expected command to be hidden"); }
public void ProjectSonarLintMenuCommand_QueryStatus_AllSupportedProjects_IsEnabledIsVisible() { // Setup OleMenuCommand command = CommandHelper.CreateRandomOleMenuCommand(); var testSubject = new ProjectSonarLintMenuCommand(serviceProvider); var p1 = new ProjectMock("cs1.proj"); p1.SetCSProjectKind(); var p2 = new ProjectMock("cs2.proj"); p2.SetCSProjectKind(); this.projectSystem.SelectedProjects = new[] { p1, p2 }; // Act testSubject.QueryStatus(command, null); // Verify Assert.IsTrue(command.Enabled, "Expected command to be enabled"); Assert.IsTrue(command.Visible, "Expected command to be visible"); }