-
Notifications
You must be signed in to change notification settings - Fork 280
Closed
Labels
Area: MTPBelongs to the Microsoft.Testing.Platform core libraryBelongs to the Microsoft.Testing.Platform core libraryDiscussion
Description
Publishing a test node with a display name containing an escape character causes it to be escaped in the console output also.
internal class DummyAdapter : ITestFramework, IDataProducer
{
public string Uid => nameof(DummyAdapter);
public string Version => string.Empty;
public string DisplayName => string.Empty;
public string Description => string.Empty;
public Type[] DataTypesProduced => [typeof(TestNodeUpdateMessage)];
public Task<CloseTestSessionResult> CloseTestSessionAsync(CloseTestSessionContext context) => Task.FromResult(new CloseTestSessionResult { IsSuccess = true });
public Task<CreateTestSessionResult> CreateTestSessionAsync(CreateTestSessionContext context) => Task.FromResult(new CreateTestSessionResult { IsSuccess = true });
public async Task ExecuteRequestAsync(ExecuteRequestContext context)
{
for (int i = 0; i < 15; i++)
{
await context.MessageBus.PublishAsync(this, new TestNodeUpdateMessage(new SessionUid("1"), new TestNode
{
Uid = $"{i}",
DisplayName = $"Hello(\nWorld {i})",
Properties = new PropertyBag(GetRandomState())
}));
}
context.Complete();
}
private static IProperty GetRandomState()
{
IProperty[] states = [ PassedTestNodeStateProperty.CachedInstance, SkippedTestNodeStateProperty.CachedInstance, new FailedTestNodeStateProperty("Oops") ];
Random.Shared.Shuffle(states);
return states.First();
}
public Task<bool> IsEnabledAsync() => Task.FromResult(true);
}
dotnet run --output Detailed
Results in:
These should probably be shown literally to avoid weird console display
Copilot
Metadata
Metadata
Assignees
Labels
Area: MTPBelongs to the Microsoft.Testing.Platform core libraryBelongs to the Microsoft.Testing.Platform core libraryDiscussion