public void CanSetValue_AlwaysReturnsFalse(string key) { // Arrange & Act var entry = new ErrorListTableEntry(_testMessage, LogLevel.Debug); // Assert entry.Should().NotBeNull(); entry.CanSetValue(key).Should().BeFalse(); }
public void StringConstructor_CreatesLogMessage() { // Arrange & Act var entry = new ErrorListTableEntry(_testMessage, LogLevel.Debug); // Assert entry.Should().NotBeNull(); entry.Message.Should().NotBeNull(); entry.Message.Message.Should().Be(_testMessage); entry.Message.Code.Should().Be(NuGetLogCode.Undefined); entry.Message.Level.Should().Be(LogLevel.Debug); }
public void LogMessageConstructor_KeepsLogMessage() { // Arrange var logMessage = new LogMessage(LogLevel.Debug, _testMessage, _testCode); // Act var entry = new ErrorListTableEntry(logMessage); // Assert entry.Should().NotBeNull(); entry.Message.Should().Be(logMessage); }
public void TryGetValue_IntContentNotAvailable_ReturnsZero(string key) { // Arrange var logMessage = new LogMessage(LogLevel.Error, _testMessage, _testCode); // Act var entry = new ErrorListTableEntry(logMessage); // Assert entry.Should().NotBeNull(); entry.TryGetValue(key, out var result).Should().BeFalse(); result.Should().BeNull(); }
public void TryGetValue_StringContent_ReturnsValues(string key, string content) { // Arrange var logMessage = new RestoreLogMessage(LogLevel.Error, _testCode, _testMessage) { ProjectPath = _testProjectPath }; // Act var entry = new ErrorListTableEntry(logMessage); // Assert entry.Should().NotBeNull(); entry.TryGetValue(key, out var result).Should().BeTrue(); (result is string).Should().BeTrue(); (result as string).Should().Be(content); }
public void TryGetValue_IntContent_ReturnsValues(string key, int content) { // Arrange var logMessage = new RestoreLogMessage(LogLevel.Error, _testCode, _testMessage) { StartLineNumber = _testLineNumber, StartColumnNumber = _testColumnNumber }; // Act var entry = new ErrorListTableEntry(logMessage); // Assert entry.Should().NotBeNull(); entry.TryGetValue(key, out var result).Should().BeTrue(); (result is int).Should().BeTrue(); ((int)result).Should().Be(content); }