mirror of
https://github.com/ckaczor/sqltoolsservice.git
synced 2026-01-14 01:25:40 -05:00
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:
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user