mirror of
https://github.com/ckaczor/sqltoolsservice.git
synced 2026-01-23 17:24:12 -05:00
include additional data for error object (#1539)
* include additional data for error * fix tests
This commit is contained in:
@@ -21,7 +21,7 @@ namespace Microsoft.SqlTools.ServiceLayer.UnitTests.Formatter
|
||||
{
|
||||
public class TSqlFormatterServiceTests : FormatterUnitTestsBase
|
||||
{
|
||||
private Mock<ServiceLayer.Workspace.Workspace> workspaceMock;
|
||||
private Mock<ServiceLayer.Workspace.Workspace> workspaceMock;
|
||||
private TextDocumentIdentifier textDocument;
|
||||
DocumentFormattingParams docFormatParams;
|
||||
DocumentRangeFormattingParams rangeFormatParams;
|
||||
@@ -60,7 +60,7 @@ namespace Microsoft.SqlTools.ServiceLayer.UnitTests.Formatter
|
||||
C1 int NOT NULL,
|
||||
C2 nvarchar(50) NULL
|
||||
)");
|
||||
|
||||
|
||||
private void SetupLanguageService(bool skipFile = false)
|
||||
{
|
||||
LanguageServiceMock.Setup(x => x.ShouldSkipNonMssqlFile(It.IsAny<string>())).Returns(skipFile);
|
||||
@@ -216,11 +216,11 @@ namespace Microsoft.SqlTools.ServiceLayer.UnitTests.Formatter
|
||||
await test(contextMock.Object);
|
||||
VerifyResult(contextMock, verify);
|
||||
}
|
||||
|
||||
|
||||
public static void VerifyResult<T>(Mock<RequestContext<T>> contextMock, Action verify)
|
||||
{
|
||||
contextMock.Verify(c => c.SendResult(It.IsAny<T>()), Times.Once);
|
||||
contextMock.Verify(c => c.SendError(It.IsAny<string>(), It.IsAny<int>()), Times.Never);
|
||||
contextMock.Verify(c => c.SendError(It.IsAny<string>(), It.IsAny<int>(), It.IsAny<string>()), Times.Never);
|
||||
verify();
|
||||
}
|
||||
|
||||
@@ -253,7 +253,7 @@ namespace Microsoft.SqlTools.ServiceLayer.UnitTests.Formatter
|
||||
};
|
||||
return scriptFile;
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user