Fixing project names to fix VS bugs

For whatever reason, Visual Studio throws a fit if a referenced project has a name
and the folder name (which is used to reference the project) is different than that name.
To solve this issue, I've renamed all the projects and folders to match their project
names as stated in the project.json.
This commit is contained in:
Benjamin Russell
2016-07-29 16:55:44 -07:00
parent bb0cd461b6
commit e83d2704b9
83 changed files with 5 additions and 5 deletions

View File

@@ -0,0 +1,144 @@
//
// Copyright (c) Microsoft. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
//
using Microsoft.SqlTools.ServiceLayer.Hosting.Protocol.Serializers;
using HostingMessage = Microsoft.SqlTools.ServiceLayer.Hosting.Protocol.Contracts.Message;
using Newtonsoft.Json.Linq;
using Xunit;
namespace Microsoft.SqlTools.ServiceLayer.Test.ServiceHost
{
public class TestMessageContents
{
public const string SomeFieldValue = "Some value";
public const int NumberValue = 42;
public string SomeField { get; set; }
public int Number { get; set; }
public TestMessageContents()
{
this.SomeField = SomeFieldValue;
this.Number = NumberValue;
}
}
public class JsonRpcMessageSerializerTests
{
private IMessageSerializer messageSerializer;
private const string MessageId = "42";
private const string MethodName = "testMethod";
private static readonly JToken MessageContent = JToken.FromObject(new TestMessageContents());
public JsonRpcMessageSerializerTests()
{
this.messageSerializer = new JsonRpcMessageSerializer();
}
[Fact]
public void SerializesRequestMessages()
{
var messageObj =
this.messageSerializer.SerializeMessage(
HostingMessage.Request(
MessageId,
MethodName,
MessageContent));
AssertMessageFields(
messageObj,
checkId: true,
checkMethod: true,
checkParams: true);
}
[Fact]
public void SerializesEventMessages()
{
var messageObj =
this.messageSerializer.SerializeMessage(
HostingMessage.Event(
MethodName,
MessageContent));
AssertMessageFields(
messageObj,
checkMethod: true,
checkParams: true);
}
[Fact]
public void SerializesResponseMessages()
{
var messageObj =
this.messageSerializer.SerializeMessage(
HostingMessage.Response(
MessageId,
null,
MessageContent));
AssertMessageFields(
messageObj,
checkId: true,
checkResult: true);
}
[Fact]
public void SerializesResponseWithErrorMessages()
{
var messageObj =
this.messageSerializer.SerializeMessage(
HostingMessage.ResponseError(
MessageId,
null,
MessageContent));
AssertMessageFields(
messageObj,
checkId: true,
checkError: true);
}
private static void AssertMessageFields(
JObject messageObj,
bool checkId = false,
bool checkMethod = false,
bool checkParams = false,
bool checkResult = false,
bool checkError = false)
{
JToken token = null;
Assert.True(messageObj.TryGetValue("jsonrpc", out token));
Assert.Equal("2.0", token.ToString());
if (checkId)
{
Assert.True(messageObj.TryGetValue("id", out token));
Assert.Equal(MessageId, token.ToString());
}
if (checkMethod)
{
Assert.True(messageObj.TryGetValue("method", out token));
Assert.Equal(MethodName, token.ToString());
}
if (checkError)
{
// TODO
}
else
{
string contentField = checkParams ? "params" : "result";
Assert.True(messageObj.TryGetValue(contentField, out token));
Assert.True(JToken.DeepEquals(token, MessageContent));
}
}
}
}