public void WriteSolution_WriteOpFails_CredentialsNotSaved() { // Arrange SetSolutionFilePath(@"c:\my solution file.foo"); var expectedFilePath = @"c:\.sonarlint\my solution file.slconfig"; fileMock.Setup(x => x.WriteAllText(It.IsAny <string>(), It.IsAny <string>())).Throws <System.IO.IOException>(); var boundProject = new BoundSonarQubeProject { ProjectKey = "mykey", ServerUri = new Uri("http://localhost:9000"), }; // Act var actualFilePath = testSubject.WriteSolutionBinding(boundProject); // queue the changes configurableSccFileSystem.WritePendingErrorsExpected(); // write the queued changes // Assert actualFilePath.Should().Be(expectedFilePath); var savedCredentials = configurableStore.ReadCredentials(new Uri("http://localhost:9000")); savedCredentials.Should().BeNull(); }