Initial check-in of SqlProjects service addition to SqlToolsService (#1805)

* initial commit

* Initial SqlProjects service + tests

* Added SqlObject script tests; PR feedback

* Added comments for contracts

* Swapping SqlProjectResult for ResultStatus

* Updating tests

* Added automatic test base that provides a working directory and automatic cleanup.
This commit is contained in:
Benjin Dubishar
2023-01-25 14:16:15 -08:00
committed by GitHub
parent da6bb1c6c3
commit 9cce26fcbd
16 changed files with 553 additions and 1 deletions

View File

@@ -13,7 +13,6 @@ namespace Microsoft.SqlTools.ServiceLayer.Test.Common.RequestContextMocking
{
public static class RequestContextMocks
{
public static Mock<RequestContext<TResponse>> Create<TResponse>(Action<TResponse> resultCallback)
{
var requestContext = new Mock<RequestContext<TResponse>>();
@@ -61,4 +60,18 @@ namespace Microsoft.SqlTools.ServiceLayer.Test.Common.RequestContextMocking
return mock;
}
}
public class MockRequest<T>
{
private T? result;
public T Result => result ?? throw new InvalidOperationException("No result has been sent for the request");
public Mock<RequestContext<T>> Mock;
public RequestContext<T> Object => Mock.Object;
public MockRequest()
{
Mock = RequestContextMocks.Create<T>(actual => result = actual);
}
}
}