-
Notifications
You must be signed in to change notification settings - Fork 22
/
Copy pathPaymentTest.cs
68 lines (61 loc) · 2.43 KB
/
PaymentTest.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
60
61
62
63
64
65
66
67
68
using System.Collections.Generic;
using Bunq.Sdk.Context;
using Bunq.Sdk.Model.Generated.Endpoint;
using Bunq.Sdk.Model.Generated.Object;
using Xunit;
namespace Bunq.Sdk.Tests.Model.Generated.Endpoint
{
/// <summary>
/// Tests:
/// Payment
/// </summary>
public class PaymentTest : BunqSdkTestBase
{
/// <summary>
/// Config values.
/// </summary>
private const string PaymentAmountEur = "0.01";
private const string PaymentCurrency = "EUR";
private const string PaymentDescription = "C# test Payment";
private static readonly int UserId = Config.GetUserId();
private static readonly int MonetaryAccountId = Config.GetMonetarytAccountId();
private static readonly Pointer CounterPartySelf = Config.GetCounterPartyAliasSelf();
private static readonly Pointer CounterPartyOther = Config.GetCounterPartyAliasOther();
/// <summary>
/// API context to use for the test API calls.
/// </summary>
private static readonly ApiContext ApiContext = GetApiContext();
/// <summary>
/// Tests making a payment to another sanndbox user.
///
/// This test has no asserion as it is testing to see if the code runs without errors.
/// </summary>
[Fact]
public void TestMakePaymentToOtherUser()
{
var requestMap = new Dictionary<string, object>
{
{Payment.FIELD_AMOUNT, new Amount(PaymentAmountEur, PaymentCurrency)},
{Payment.FIELD_DESCRIPTION, PaymentDescription},
{Payment.FIELD_COUNTERPARTY_ALIAS, CounterPartyOther}
};
Payment.Create(ApiContext, requestMap, UserId, MonetaryAccountId);
}
/// <summary>
/// Tests making a payment to another monetary account.
///
/// This test has no asserion as it is testing to see if the code runs without errors.
/// </summary>
[Fact]
public void TestMakePaymentToOtherAccount()
{
var requestMap = new Dictionary<string, object>
{
{Payment.FIELD_AMOUNT, new Amount(PaymentAmountEur, PaymentCurrency)},
{Payment.FIELD_DESCRIPTION, PaymentDescription},
{Payment.FIELD_COUNTERPARTY_ALIAS, CounterPartySelf}
};
Payment.Create(ApiContext, requestMap, UserId, MonetaryAccountId);
}
}
}