-
Notifications
You must be signed in to change notification settings - Fork 22
/
Copy pathMonetaryAccountBankTest.cs
59 lines (53 loc) · 2.32 KB
/
MonetaryAccountBankTest.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
using System.Collections.Generic;
using Bunq.Sdk.Context;
using Bunq.Sdk.Model.Generated.Endpoint;
using Xunit;
namespace Bunq.Sdk.Tests.Model.Generated.Endpoint
{
/// <summary>
/// Tests:
/// MonetaryAccountBank
/// </summary>
public class MonetaryAccountBankTest : BunqSdkTestBase
{
/// <summary>
/// Config values
/// </summary>
private const string MonetaryAccountBankStatus = "CANCELLED";
private const string MonetaryAccountBankSubStatus = "REDEMPTION_VOLUNTARY";
private const string MonetaryAccountBankReason = "OTHER";
private const string MonetaryAccountBankReasonDescription = "Because this is a test";
private const string MonetaryAccountBankCurrency = "EUR";
private const string MonetaryAccountBankDescription = "Test C# monetary account";
private static readonly int UserId = Config.GetUserId();
/// <summary>
/// API context used for the test API calls.
/// </summary>
private static readonly ApiContext ApiContext = GetApiContext();
/// <summary>
/// Tests the creation of a new monetary account. This accoult will then be removed afterwards.
/// </summary>
[Fact]
public void TestCreationNewMonetaryAccount()
{
var requestMap = new Dictionary<string, object>
{
{MonetaryAccountBank.FIELD_CURRENCY, MonetaryAccountBankCurrency},
{MonetaryAccountBank.FIELD_DESCRIPTION, MonetaryAccountBankDescription}
};
var monetaryAccountToCloseId = MonetaryAccountBank.Create(ApiContext, requestMap, UserId).Value;
DeleteMonetaryAccount(monetaryAccountToCloseId);
}
private static void DeleteMonetaryAccount(int idToClose)
{
var requestMap = new Dictionary<string, object>
{
{MonetaryAccountBank.FIELD_STATUS, MonetaryAccountBankStatus},
{MonetaryAccountBank.FIELD_SUB_STATUS, MonetaryAccountBankSubStatus},
{MonetaryAccountBank.FIELD_REASON, MonetaryAccountBankReason},
{MonetaryAccountBank.FIELD_REASON_DESCRIPTION, MonetaryAccountBankReasonDescription}
};
MonetaryAccountBank.Update(ApiContext, requestMap, UserId, idToClose);
}
}
}