Use MemoryStream instead of stdout for outgoing messages during integration tests (#1696)

* filter

* test

* run all

* Redirect to memorystream

* revert temp changes
This commit is contained in:
Charles Gagnon
2022-09-16 15:38:53 -07:00
committed by GitHub
parent 006ac60923
commit 019481e8db
6 changed files with 24 additions and 15 deletions

View File

@@ -6,6 +6,7 @@
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Threading;
using System.Threading.Tasks;
using Microsoft.SqlTools.Hosting.Protocol.Channel;
@@ -68,12 +69,12 @@ namespace Microsoft.SqlTools.Hosting.Protocol
/// <summary>
/// Initializes
/// </summary>
public void Initialize()
public void Initialize(Stream inputStream = null, Stream outputStream = null)
{
if (!this.isInitialized)
{
// Start the provided protocol channel
this.protocolChannel.Start(this.messageProtocolType);
this.protocolChannel.Start(this.messageProtocolType, inputStream, outputStream);
// Start the message dispatcher
this.MessageDispatcher = new MessageDispatcher(this.protocolChannel);