SonarLint.VisualStudio.Integration.UnitTests.ConfigurableSourceControlledFileSystem.WritePendingNoErrorsExpected C# (CSharp) Method

WritePendingNoErrorsExpected() public method

public WritePendingNoErrorsExpected ( ) : void
return void
        public void WritePendingNoErrorsExpected()
        {
            Assert.IsTrue(((ISourceControlledFileSystem)this).WriteQueuedFiles(), "Failed to write all the pending files");
        }

Usage Example

        public void WriteSolution_NoCredentials_FileSavedOk()
        {
            // Arrange
            SetSolutionFilePath(@"c:\mysolutionfile.foo");
            var expectedFilePath = @"c:\.sonarlint\mysolutionfile.slconfig";

            var boundProject = new BoundSonarQubeProject
            {
                ProjectKey = "mykey",
                ServerUri  = new Uri("http://localhost:9000"),
            };

            // Act
            var actualFilePath = testSubject.WriteSolutionBinding(boundProject); // queue the changes

            configurableSccFileSystem.WritePendingNoErrorsExpected();            // write the queued changes

            // Assert
            actualFilePath.Should().Be(expectedFilePath);
            fileMock.Verify(x => x.WriteAllText(expectedFilePath, It.IsAny <string>()), Times.Once);
            var savedCredentials = configurableStore.ReadCredentials(new Uri("http://localhost:9000"));

            savedCredentials.Should().BeNull();
        }