public void ProjectTestPropertySetCommand_QueryStatus_SingleProject_UnsupportedProject_IsDisabledIsHidden() { // Setup OleMenuCommand command = CommandHelper.CreateRandomOleMenuCommand(); var testSubject = new ProjectTestPropertySetCommand(serviceProvider, null); var project = new ProjectMock("mcproject.csproj"); this.projectSystem.SelectedProjects = new[] { project }; // 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 ProjectTestPropertySetCommand_QueryStatus_SingleProject_UnsupportedProject_IsDisabledIsHidden() { // Arrange OleMenuCommand command = CommandHelper.CreateRandomOleMenuCommand(); var testSubject = new ProjectTestPropertySetCommand(propertyManager, null); var project = new ProjectMock("mcproject.csproj"); this.projectSystem.SelectedProjects = new[] { project }; // 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 ProjectTestPropertySetCommand_QueryStatus_MissingPropertyManager_IsDisabledIsHidden() { // Arrange OleMenuCommand command = CommandHelper.CreateRandomOleMenuCommand(); ProjectTestPropertySetCommand testSubject; using (new AssertIgnoreScope()) // we want to be missing the MEF service { testSubject = new ProjectTestPropertySetCommand(propertyManager, null); } // 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 ProjectTestPropertySetCommand_QueryStatus_SingleProject_SupportedProject_IsEnabledIsVisible() { // Arrange OleMenuCommand command = CommandHelper.CreateRandomOleMenuCommand(); var testSubject = new ProjectTestPropertySetCommand(serviceProvider, null); var project = new ProjectMock("mcproject.csproj"); project.SetCSProjectKind(); this.projectSystem.SelectedProjects = new[] { project }; // Act testSubject.QueryStatus(command, null); // Assert command.Enabled.Should().BeTrue("Expected command to be enabled"); command.Visible.Should().BeTrue("Expected command to be visible"); }
public void ProjectTestPropertySetCommand_QueryStatus_MultipleProjects_MixedSupportedProjects_IsDisabledIsHidden() { // Arrange OleMenuCommand command = CommandHelper.CreateRandomOleMenuCommand(); var testSubject = new ProjectTestPropertySetCommand(this.propertyManager, null); var unsupportedProject = new ProjectMock("bad.proj"); var supportedProject = new ProjectMock("good.proj"); supportedProject.SetCSProjectKind(); this.projectSystem.SelectedProjects = new[] { unsupportedProject, supportedProject }; // 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 ProjectTestPropertySetCommand_QueryStatus_MultipleProjects_MixedSupportedProjects_IsDisabledIsHidden() { // Setup OleMenuCommand command = CommandHelper.CreateRandomOleMenuCommand(); var testSubject = new ProjectTestPropertySetCommand(this.serviceProvider, null); var unsupportedProject = new ProjectMock("bad.proj"); var supportedProject = new ProjectMock("good.proj"); supportedProject.SetCSProjectKind(); this.projectSystem.SelectedProjects = new[] { unsupportedProject, supportedProject }; // 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 ProjectTestPropertySetCommand_QueryStatus_MissingPropertyManager_IsDisabledIsHidden() { // Setup OleMenuCommand command = CommandHelper.CreateRandomOleMenuCommand(); var localProvider = new ConfigurableServiceProvider(assertOnUnexpectedServiceRequest: false); ProjectTestPropertySetCommand testSubject; using (new AssertIgnoreScope()) // we want to be missing the MEF service { testSubject = new ProjectTestPropertySetCommand(localProvider, null); } // 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 ProjectTestPropertySetCommand_QueryStatus_MultipleProjects_AllSupportedProjects_IsEnabledIsVisible() { // Arrange OleMenuCommand command = CommandHelper.CreateRandomOleMenuCommand(); var testSubject = new ProjectTestPropertySetCommand(this.propertyManager, null); var p1 = new ProjectMock("good1.proj"); var p2 = new ProjectMock("good2.proj"); p1.SetCSProjectKind(); 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"); }
public void ProjectTestPropertySetCommand_QueryStatus_MultipleProjects_AllSupportedProjects_IsEnabledIsVisible() { // Setup OleMenuCommand command = CommandHelper.CreateRandomOleMenuCommand(); var testSubject = new ProjectTestPropertySetCommand(this.serviceProvider, null); var p1 = new ProjectMock("good1.proj"); var p2 = new ProjectMock("good2.proj"); p1.SetCSProjectKind(); 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"); }