AssertOutputStrings() public method

public AssertOutputStrings ( ) : void
return void
Ejemplo n.º 1
0
        public void Execute_NoErrors_Succeed()
        {
            // Arrange
            ThreadHelper.SetCurrentThreadAsUIThread();

            host.TestStateManager.IsBusy = false;
            configProvider.ModeToReturn  = SonarLintMode.Connected;

            bool disconnectCalled = false;

            section.DisconnectCommand = new RelayCommand(exec =>
            {
                host.TestStateManager.IsBusy.Should().BeTrue();     // check busy flag is set
                disconnectCalled = true;
            });

            // Act
            testSubject.Execute();

            // Assert
            configProvider.DeleteCallCount.Should().Be(1);
            disconnectCalled.Should().BeTrue();

            outputWindowPane.AssertOutputStrings(
                Strings.Unbind_State_Started,
                Strings.Unbind_DeletingBinding,
                Strings.Unbind_DisconnectingFromSonarQube,
                Strings.Unbind_State_Succeeded);
            host.VisualStateManager.IsBusy.Should().BeFalse();
        }
Ejemplo n.º 2
0
        public void ConflictsManager_GetCurrentConflicts_MissingBaselineFile()
        {
            // Arrange
            this.SetSolutionBinding(SonarLintMode.LegacyConnected);
            this.SetValidProjects();

            // Act + Assert
            testSubject.GetCurrentConflicts().Should().BeEmpty("Not expecting any conflicts since the solution baseline is missing");
            this.outputWindowPane.AssertOutputStrings(1);

            var expectedBaselineLocation = configProvider.GetConfiguration()
                                           .BuildPathUnderConfigDirectory(ProjectToLanguageMapper
                                                                          .GetLanguageForProject(projectHelper.FilteredProjects.First()).FileSuffixAndExtension);

            outputWindowPane.AssertOutputStrings(1);
            this.outputWindowPane.AssertPartialOutputStrings(expectedBaselineLocation);
        }