public void ProjectSonarLintMenuCommand_QueryStatus_NoProjects_IsDisableIsHidden() { // Arrange OleMenuCommand command = CommandHelper.CreateRandomOleMenuCommand(); var testSubject = new ProjectSonarLintMenuCommand(serviceProvider); // Act testSubject.QueryStatus(command, null); // Assert command.Enabled.Should().BeFalse("Expected command to be disabled"); command.Visible.Should().BeFalse("Expected command to be hidden"); }
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() { // Arrange 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); // Assert command.Enabled.Should().BeFalse("Expected command to be disabled"); command.Visible.Should().BeFalse("Expected command to be hidden"); }
public void ProjectSonarLintMenuCommand_QueryStatus_AllSupportedProjects_IsEnabledIsVisible() { // Arrange 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); // Assert command.Enabled.Should().BeTrue("Expected command to be enabled"); command.Visible.Should().BeTrue("Expected command to be visible"); }