public async Task SaveCredentialThrowsIfCredentialIdMissing() { string errorResponse = null; var contextMock = RequestContextMocks.Create <bool>(null).AddErrorHandling((msg, code) => errorResponse = msg); await service.HandleSaveCredentialRequest(new Credential(null), contextMock.Object); TestUtils.VerifyErrorSent(contextMock); Assert.Contains("ArgumentException", errorResponse); }
public async Task SaveCredentialThrowsIfCredentialIdMissing() { object errorResponse = null; var contextMock = RequestContextMocks.Create <bool>(null).AddErrorHandling(obj => errorResponse = obj); await service.HandleSaveCredentialRequest(new Credential(null), contextMock.Object); VerifyErrorSent(contextMock); Assert.True(((string)errorResponse).Contains("ArgumentException")); }