Removing optional data property from Error response class (#325)

* Removing optional data property from Error response class

* Fixing broken unit tests
This commit is contained in:
Benjamin Russell
2017-04-24 13:45:33 -07:00
committed by GitHub
parent cf9a81aec9
commit e65699ef75
9 changed files with 26 additions and 57 deletions

View File

@@ -76,7 +76,7 @@ namespace Microsoft.SqlTools.ServiceLayer.UnitTests.Credentials
public async Task SaveCredentialThrowsIfCredentialIdMissing()
{
string errorResponse = null;
var contextMock = RequestContextMocks.Create<bool>(null).AddErrorHandling((msg, code, obj) => errorResponse = msg);
var contextMock = RequestContextMocks.Create<bool>(null).AddErrorHandling((msg, code) => errorResponse = msg);
await service.HandleSaveCredentialRequest(new Credential(null), contextMock.Object);
TestUtils.VerifyErrorSent(contextMock);
@@ -87,7 +87,7 @@ namespace Microsoft.SqlTools.ServiceLayer.UnitTests.Credentials
public async Task SaveCredentialThrowsIfPasswordMissing()
{
string errorResponse = null;
var contextMock = RequestContextMocks.Create<bool>(null).AddErrorHandling((msg, code, obj) => errorResponse = msg);
var contextMock = RequestContextMocks.Create<bool>(null).AddErrorHandling((msg, code) => errorResponse = msg);
await service.HandleSaveCredentialRequest(new Credential(CredentialId), contextMock.Object);
TestUtils.VerifyErrorSent(contextMock);
@@ -186,7 +186,7 @@ namespace Microsoft.SqlTools.ServiceLayer.UnitTests.Credentials
public async Task ReadCredentialThrowsIfCredentialIsNull()
{
string errorResponse = null;
var contextMock = RequestContextMocks.Create<Credential>(null).AddErrorHandling((msg, code, obj) => errorResponse = msg);
var contextMock = RequestContextMocks.Create<Credential>(null).AddErrorHandling((msg, code) => errorResponse = msg);
// Verify throws on null, and this is sent as an error
await service.HandleReadCredentialRequest(null, contextMock.Object);
@@ -198,7 +198,7 @@ namespace Microsoft.SqlTools.ServiceLayer.UnitTests.Credentials
public async Task ReadCredentialThrowsIfIdMissing()
{
string errorResponse = null;
var contextMock = RequestContextMocks.Create<Credential>(null).AddErrorHandling((msg, code, obj) => errorResponse = msg);
var contextMock = RequestContextMocks.Create<Credential>(null).AddErrorHandling((msg, code) => errorResponse = msg);
// Verify throws with no ID
await service.HandleReadCredentialRequest(new Credential(), contextMock.Object);
@@ -228,7 +228,7 @@ namespace Microsoft.SqlTools.ServiceLayer.UnitTests.Credentials
public async Task DeleteCredentialThrowsIfIdMissing()
{
object errorResponse = null;
var contextMock = RequestContextMocks.Create<bool>(null).AddErrorHandling((msg, code, obj) => errorResponse = msg);
var contextMock = RequestContextMocks.Create<bool>(null).AddErrorHandling((msg, code) => errorResponse = msg);
// Verify throws with no ID
await service.HandleDeleteCredentialRequest(new Credential(), contextMock.Object);