Applying refactor to test project

For some strange reason, the using statements don't seem to want to work
for the Message type. The full name has been used instead, but it's an
ugly workaround for the time being.
This commit is contained in:
Benjamin Russell
2016-07-22 16:56:34 -07:00
parent b9f041cdf4
commit bd83045a0a
4 changed files with 17 additions and 21 deletions

View File

@@ -3,15 +3,15 @@
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
//
using Microsoft.SqlTools.EditorServices.Protocol.MessageProtocol;
using Microsoft.SqlTools.EditorServices.Protocol.MessageProtocol.Serializers;
using System;
using System.IO;
using System.Text;
using System.Threading.Tasks;
using Microsoft.SqlTools.ServiceLayer.ServiceHost.Protocol;
using Microsoft.SqlTools.ServiceLayer.ServiceHost.Protocol.Serializers;
using Xunit;
namespace Microsoft.SqlTools.EditorServices.Test.Protocol.MessageProtocol
namespace Microsoft.SqlTools.ServiceLayer.Test.Message
{
public class MessageReaderWriterTests
{
@@ -38,7 +38,7 @@ namespace Microsoft.SqlTools.EditorServices.Test.Protocol.MessageProtocol
// Write the message and then roll back the stream to be read
// TODO: This will need to be redone!
await messageWriter.WriteMessage(Message.Event("testEvent", null));
await messageWriter.WriteMessage(ServiceLayer.ServiceHost.Protocol.Contracts.Message.Event("testEvent", null));
outputStream.Seek(0, SeekOrigin.Begin);
string expectedHeaderString =
@@ -82,7 +82,7 @@ namespace Microsoft.SqlTools.EditorServices.Test.Protocol.MessageProtocol
inputStream.Flush();
inputStream.Seek(0, SeekOrigin.Begin);
Message messageResult = messageReader.ReadMessage().Result;
ServiceLayer.ServiceHost.Protocol.Contracts.Message messageResult = messageReader.ReadMessage().Result;
Assert.Equal("testEvent", messageResult.Method);
inputStream.Dispose();
@@ -117,7 +117,7 @@ namespace Microsoft.SqlTools.EditorServices.Test.Protocol.MessageProtocol
// Read the written messages from the stream
for (int i = 0; i < overflowMessageCount; i++)
{
Message messageResult = messageReader.ReadMessage().Result;
ServiceLayer.ServiceHost.Protocol.Contracts.Message messageResult = messageReader.ReadMessage().Result;
Assert.Equal("testEvent", messageResult.Method);
}
@@ -145,7 +145,7 @@ namespace Microsoft.SqlTools.EditorServices.Test.Protocol.MessageProtocol
inputStream.Flush();
inputStream.Seek(0, SeekOrigin.Begin);
Message messageResult = messageReader.ReadMessage().Result;
ServiceLayer.ServiceHost.Protocol.Contracts.Message messageResult = messageReader.ReadMessage().Result;
Assert.Equal("testEvent", messageResult.Method);
inputStream.Dispose();

View File

@@ -3,19 +3,16 @@
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
//
using Microsoft.SqlTools.EditorServices.Protocol.MessageProtocol;
using System;
using System.Threading.Tasks;
using Microsoft.SqlTools.ServiceLayer.ServiceHost.Protocol;
namespace Microsoft.SqlTools.EditorServices.Test.Protocol.MessageProtocol
namespace Microsoft.SqlTools.ServiceLayer.Test.Message
{
#region Request Types
internal class TestRequest
{
public Task ProcessMessage(
EditorSession editorSession,
MessageWriter messageWriter)
public Task ProcessMessage(MessageWriter messageWriter)
{
return Task.FromResult(false);
}

View File

@@ -7,7 +7,7 @@
<Import Project="$(VSToolsPath)\DotNet\Microsoft.DotNet.Props" Condition="'$(VSToolsPath)' != ''" />
<PropertyGroup Label="Globals">
<ProjectGuid>2d771d16-9d85-4053-9f79-e2034737deef</ProjectGuid>
<RootNamespace>Microsoft.SqlTools.EditorServices.Test.Protocol</RootNamespace>
<RootNamespace>Microsoft.SqlTools.ServiceLayer.Test</RootNamespace>
<BaseIntermediateOutputPath Condition="'$(BaseIntermediateOutputPath)'==''">.\obj</BaseIntermediateOutputPath>
<OutputPath Condition="'$(OutputPath)'=='' ">.\bin\</OutputPath>
<TargetFrameworkVersion>v4.5.2</TargetFrameworkVersion>

View File

@@ -3,12 +3,11 @@
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
//
using Microsoft.SqlTools.EditorServices.Protocol.MessageProtocol;
using Microsoft.SqlTools.EditorServices.Protocol.MessageProtocol.Serializers;
using Microsoft.SqlTools.ServiceLayer.ServiceHost.Protocol.Serializers;
using Newtonsoft.Json.Linq;
using Xunit;
namespace Microsoft.SqlTools.EditorServices.Test.Protocol.LanguageServer
namespace Microsoft.SqlTools.ServiceLayer.Test.ServiceHost
{
public class TestMessageContents
{
@@ -44,7 +43,7 @@ namespace Microsoft.SqlTools.EditorServices.Test.Protocol.LanguageServer
{
var messageObj =
this.messageSerializer.SerializeMessage(
Message.Request(
ServiceLayer.ServiceHost.Protocol.Contracts.Message.Request(
MessageId,
MethodName,
MessageContent));
@@ -61,7 +60,7 @@ namespace Microsoft.SqlTools.EditorServices.Test.Protocol.LanguageServer
{
var messageObj =
this.messageSerializer.SerializeMessage(
Message.Event(
ServiceLayer.ServiceHost.Protocol.Contracts.Message.Event(
MethodName,
MessageContent));
@@ -76,7 +75,7 @@ namespace Microsoft.SqlTools.EditorServices.Test.Protocol.LanguageServer
{
var messageObj =
this.messageSerializer.SerializeMessage(
Message.Response(
ServiceLayer.ServiceHost.Protocol.Contracts.Message.Response(
MessageId,
null,
MessageContent));
@@ -92,7 +91,7 @@ namespace Microsoft.SqlTools.EditorServices.Test.Protocol.LanguageServer
{
var messageObj =
this.messageSerializer.SerializeMessage(
Message.ResponseError(
ServiceLayer.ServiceHost.Protocol.Contracts.Message.ResponseError(
MessageId,
null,
MessageContent));