public void ProcessFile_HeaderFile_IsNotProcessed() { // Arrange var daemonMock = new Mock <ISonarLintDaemon>(); var issueConsumerMock = new Mock <IIssueConsumer>(); var loggerMock = new Mock <ILogger>(); var projectItemMock = new Mock <ProjectItem>(); // Act CFamily.ProcessFile(daemonMock.Object, issueConsumerMock.Object, loggerMock.Object, projectItemMock.Object, "c:\\dummy\\file.h", "charset"); // Assert AssertMessageLogged(loggerMock, "Cannot analyze header files. File: 'c:\\dummy\\file.h'"); AssertFileNotAnalysed(daemonMock); }
public void ProcessFile_ErrorGetting_IsHandled() { // Arrange var daemonMock = new Mock <ISonarLintDaemon>(); var issueConsumerMock = new Mock <IIssueConsumer>(); var loggerMock = new Mock <ILogger>(); var projectItemMock = CreateProjectItemWithProject("c:\\foo\\xxx.vcxproj"); // Act CFamily.ProcessFile(daemonMock.Object, issueConsumerMock.Object, loggerMock.Object, projectItemMock.Object, "c:\\dummy\\file.cpp", "charset"); // Assert AssertPartialMessageLogged(loggerMock, "Unable to collect C/C++ configuration for c:\\dummy\\file.cpp: "); AssertFileNotAnalysed(daemonMock); }
public void ProcessFile_FileOutsideSolution_IsNotProcessed() { // Arrange var daemonMock = new Mock <ISonarLintDaemon>(); var issueConsumerMock = new Mock <IIssueConsumer>(); var loggerMock = new Mock <ILogger>(); var projectItemMock = CreateProjectItemWithProject("c:\\foo\\SingleFileISense\\xxx.vcxproj"); // Act CFamily.ProcessFile(daemonMock.Object, issueConsumerMock.Object, loggerMock.Object, projectItemMock.Object, "c:\\dummy\\file.cpp", "charset"); // Assert AssertMessageLogged(loggerMock, "Unable to retrieve the configuration for file 'c:\\dummy\\file.cpp'. Check the file is part of a project in the current solution."); AssertFileNotAnalysed(daemonMock); }