Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,9 @@

// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("9d6a9e5b-eb41-472a-90b2-df7e5eb43397")]

// TODO: Come up with something better...
// Hacky solution because StringWriter used by UserMessageLoggerTests
// gets polluted from ArgHelpersTests, wherein Console.Error.WriteLine() is used.
// Running the tests sequentially is slower but prevents pollution of Console.Error.
[assembly: CollectionBehavior(DisableTestParallelization = true)]
19 changes: 9 additions & 10 deletions test/Kontent.Ai.ModelGenerator.Tests/UserMessageLoggerTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -67,19 +67,18 @@ public void LogWarning_MessageIsNullOrWhitespace_MessageIsNotLoggedToConsole(str
_stringWriter.Flush();
}

// TODO: Fix this test
// [Fact]
// public async Task LogErrorAsync_MessageIsLoggedToConsole()
// {
// var message = "message";
// var expectedMessage = $"{message}{Environment.NewLine}";
[Fact]
public async Task LogErrorAsync_MessageIsLoggedToConsole()
{
var message = "message";
var expectedMessage = $"{message}{Environment.NewLine}";

// await _userMessageLogger.LogErrorAsync(message);
await _userMessageLogger.LogErrorAsync(message);

// _stringWriter.ToString().Should().Be(expectedMessage);
_stringWriter.ToString().Should().Be(expectedMessage);

// await _stringWriter.FlushAsync();
// }
await _stringWriter.FlushAsync();
}

[Theory]
[InlineData("")]
Expand Down