Skip to content

Commit a0b4e4f

Browse files
author
Kevin Hellemun
committed
Fixed broken tests. (#76)
1 parent 882ed7e commit a0b4e4f

File tree

2 files changed

+19
-4
lines changed

2 files changed

+19
-4
lines changed

BunqSdk.Samples/CardDebitSample.cs

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,16 +14,24 @@ public class CardDebitSample : ISample
1414
private const string POINTER_TYPE_EMAIL = "EMAIL";
1515
private const string EMAIL_YOUR_COMPANY = "at@at.at"; // Put your user email here
1616
private const string POINTER_NAME_TEST = "test pointer";
17+
private const string CARD_PIN_ASSIGNMENT_TYPE_PRIMARY = "PRIMARY";
1718
private const int USER_ITEM_ID = 0; // Put your user ID here
19+
private const int MONETARY_ACCOUNT_ID = 0; // Put your monetaryAccount ID here
1820

1921
public void Run()
2022
{
2123
var apiContext = ApiContext.Restore();
24+
var cardPinAssignment = new CardPinAssignment(
25+
CARD_PIN_ASSIGNMENT_TYPE_PRIMARY,
26+
PIN_CODE,
27+
MONETARY_ACCOUNT_ID
28+
);
29+
var allCardPinAssignments = new List<CardPinAssignment> {cardPinAssignment};
2230
var requestMap = new Dictionary<string, object>
2331
{
2432
{CardDebit.FIELD_NAME_ON_CARD, NAME_YOUR_COMPANY},
2533
{CardDebit.FIELD_SECOND_LINE, GenerateRandomSecondLine()},
26-
{CardDebit.FIELD_PIN_CODE, PIN_CODE},
34+
{CardDebit.FIELD_PIN_CODE_ASSIGNMENT, allCardPinAssignments},
2735
{
2836
CardDebit.FIELD_ALIAS,
2937
new Pointer(POINTER_TYPE_EMAIL, EMAIL_YOUR_COMPANY) {Name = POINTER_NAME_TEST}
@@ -40,4 +48,4 @@ private static string GenerateRandomSecondLine()
4048
return random.Next(0, (int) Math.Pow(10, 21) - 1).ToString();
4149
}
4250
}
43-
}
51+
}

BunqSdk.Tests/Model/Generated/Endpoint/CardDebitTest.cs

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ public class CardDebitTest : BunqSdkTestBase
1717
/// <summary>
1818
/// Config values.
1919
/// </summary>
20+
private const string CARD_PIN_ASSIGNMENT_TYPE_PRIMARY = "PRIMARY";
21+
2022
private const string PIN_CODE = "4045";
2123
private const int INDEX_FIRST = 0;
2224
private const int NONNEGATIVE_INTEGER_MINIMUM = 0;
@@ -37,11 +39,16 @@ public class CardDebitTest : BunqSdkTestBase
3739
[Fact]
3840
public void TestOrderNewMaestroCard()
3941
{
42+
var cardPinAssignment = new CardPinAssignment(
43+
CARD_PIN_ASSIGNMENT_TYPE_PRIMARY,
44+
PIN_CODE,
45+
Config.GetMonetarytAccountId());
46+
var allCardPinAssignments = new List<CardPinAssignment> {cardPinAssignment};
4047
var cardDebitMap = new Dictionary<string, object>
4148
{
4249
{CardDebit.FIELD_ALIAS, GetAlias()},
4350
{CardDebit.FIELD_NAME_ON_CARD, GetAnAllowedName()},
44-
{CardDebit.FIELD_PIN_CODE, PIN_CODE},
51+
{CardDebit.FIELD_PIN_CODE_ASSIGNMENT, allCardPinAssignments},
4552
{CardDebit.FIELD_SECOND_LINE, GenerateRandomSecondLine()}
4653
};
4754
var cardDebit = CardDebit.Create(API_CONTEXT, cardDebitMap, USER_ID).Value;
@@ -73,4 +80,4 @@ private static Pointer GetAlias()
7380
return User.Get(API_CONTEXT, USER_ID).Value.UserCompany.Alias[INDEX_FIRST];
7481
}
7582
}
76-
}
83+
}

0 commit comments

Comments
 (0)