Skip to content

Commit 6eddd49

Browse files
author
Kevin Hellemun
committed
Added test to ensure that the response id is populated with data. (#63)
1 parent e775766 commit 6eddd49

File tree

2 files changed

+40
-0
lines changed

2 files changed

+40
-0
lines changed

.idea/.idea.BunqSdk/.idea/contentModel.xml

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
using System;
2+
using Bunq.Sdk.Context;
3+
using Bunq.Sdk.Exception;
4+
using Bunq.Sdk.Model.Generated.Endpoint;
5+
using Xunit;
6+
7+
namespace Bunq.Sdk.Tests.Http
8+
{
9+
public class ResponseIdOnBadRequestTest : BunqSdkTestBase
10+
{
11+
/// <summary>
12+
/// API context to use for the test API calls.
13+
/// </summary>
14+
private static readonly ApiContext API_CONTEXT = GetApiContext();
15+
16+
/// <summary>
17+
/// Invalid user id to trigger BadRequestException
18+
/// </summary>
19+
private static int INVALID_USER_PERSON_ID = 0;
20+
21+
[Fact]
22+
public void TestBadRequestWithResponseId()
23+
{
24+
ApiException caughtException = null;
25+
26+
try
27+
{
28+
UserPerson.Get(API_CONTEXT, INVALID_USER_PERSON_ID);
29+
}
30+
catch (ApiException e)
31+
{
32+
caughtException = e;
33+
}
34+
35+
Assert.NotNull(caughtException);
36+
Assert.NotNull(caughtException.ResponsId);
37+
}
38+
}
39+
}

0 commit comments

Comments
 (0)