public void TryGetConfig_ErrorsAreLogged()
        {
            // Arrange
            var    loggerMock = new Mock <ILogger>();
            string sqLanguage;

            // Act - passing a null project item so should error when it is used
            string json = CFamily.TryGetConfig(loggerMock.Object, null, "c:\\dummy", out sqLanguage);

            // Assert
            loggerMock.Verify(x => x.WriteLine(It.IsAny <string>()), Times.Once);
            json.Should().BeNull();
            sqLanguage.Should().BeNull();
        }
Esempio n. 2
0
        public void TryGetConfig_ErrorsAreLogged()
        {
            // Arrange
            var    loggerMock = new Mock <ILogger>();
            string sqLanguage;

            // Act
            using (new AssertIgnoreScope())
            {
                string json = CFamily.TryGetConfig(loggerMock.Object, null, "c:\\dummy", out sqLanguage);

                // Assert
                AssertPartialMessageLogged(loggerMock,
                                           "Unable to collect C/C++ configuration for c:\\dummy: ");
                json.Should().BeNull();
                sqLanguage.Should().BeNull();
            }
        }