Skip to content

Commit 8d92eb3

Browse files
committed
#5 Move tests to BunqResponse
1 parent f0fc054 commit 8d92eb3

File tree

8 files changed

+21
-20
lines changed

8 files changed

+21
-20
lines changed

BunqSdk.Tests/Model/Generated/AttachmentPublicTest.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,8 @@ public void TestAttachmentUploadAndRetrieval()
4242
{ApiClient.HEADER_ATTACHMENT_DESCRIPTION, ATTACHMENT_DESCRIPTION}
4343
};
4444

45-
var attachmentUuid = AttachmentPublic.Create(API_CONTEXT, fileContentBytes, customHeaders);
46-
var responseBytes = AttachmentPublicContent.List(API_CONTEXT, attachmentUuid);
45+
var attachmentUuid = AttachmentPublic.Create(API_CONTEXT, fileContentBytes, customHeaders).Value;
46+
var responseBytes = AttachmentPublicContent.List(API_CONTEXT, attachmentUuid).Value;
4747

4848
Assert.Equal(fileContentBytes, responseBytes);
4949
}

BunqSdk.Tests/Model/Generated/AvatarTest.cs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -44,10 +44,11 @@ public void TestCreateAvatarAndRetrieval()
4444
{
4545
{Avatar.FIELD_ATTACHMENT_PUBLIC_UUID, attachmentUuid}
4646
};
47-
var avatarUuid = Avatar.Create(API_CONTEXT, avatarMap);
47+
var avatarUuid = Avatar.Create(API_CONTEXT, avatarMap).Value;
4848

49-
var attachmentUuidFromAvatar = Avatar.Get(API_CONTEXT, avatarUuid).Image[INDEX_FIRST].AttachmentPublicUuid;
50-
var revievedFileContentByte = AttachmentPublicContent.List(API_CONTEXT, attachmentUuidFromAvatar);
49+
var attachmentUuidFromAvatar = Avatar.Get(API_CONTEXT, avatarUuid).Value
50+
.Image[INDEX_FIRST].AttachmentPublicUuid;
51+
var revievedFileContentByte = AttachmentPublicContent.List(API_CONTEXT, attachmentUuidFromAvatar).Value;
5152

5253
Assert.Equal(attachmentUuid, attachmentUuidFromAvatar);
5354
Assert.Equal(fileContentByte, revievedFileContentByte);
@@ -61,7 +62,7 @@ private static string UploadAvatarAndGetUuid(byte[] fileContentByte)
6162
{ApiClient.HEADER_CONTENT_TYPE, CONTEN_TYPE},
6263
};
6364

64-
return AttachmentPublic.Create(API_CONTEXT, fileContentByte, customHeaders);
65+
return AttachmentPublic.Create(API_CONTEXT, fileContentByte, customHeaders).Value;
6566
}
6667
}
6768
}

BunqSdk.Tests/Model/Generated/CardDebitTest.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -44,9 +44,9 @@ public void TestOrderNewMaestroCard()
4444
{CardDebit.FIELD_PIN_CODE, PIN_CODE},
4545
{CardDebit.FIELD_SECOND_LINE, GenerateRandomSecondLine()}
4646
};
47-
var cardDebit = CardDebit.Create(API_CONTEXT, cardDebitMap, USER_ID);
47+
var cardDebit = CardDebit.Create(API_CONTEXT, cardDebitMap, USER_ID).Value;
4848

49-
var cardFromCardEndpoint = Card.Get(API_CONTEXT, USER_ID, cardDebit.Id.Value);
49+
var cardFromCardEndpoint = Card.Get(API_CONTEXT, USER_ID, cardDebit.Id.Value).Value;
5050

5151
Assert.Equal(cardDebit.SecondLine, cardFromCardEndpoint.SecondLine);
5252
Assert.Equal(cardDebit.Created, cardFromCardEndpoint.Created);
@@ -55,7 +55,7 @@ public void TestOrderNewMaestroCard()
5555

5656
private static string GetAnAllowedName()
5757
{
58-
return CardName.List(API_CONTEXT, USER_ID)[INDEX_FIRST].PossibleCardNameArray[INDEX_FIRST];
58+
return CardName.List(API_CONTEXT, USER_ID).Value[INDEX_FIRST].PossibleCardNameArray[INDEX_FIRST];
5959
}
6060

6161
private static string GenerateRandomSecondLine()
@@ -70,7 +70,7 @@ private static string GenerateRandomSecondLine()
7070

7171
private static Pointer GetAlias()
7272
{
73-
return User.Get(API_CONTEXT, USER_ID).UserCompany.Alias[INDEX_FIRST];
73+
return User.Get(API_CONTEXT, USER_ID).Value.UserCompany.Alias[INDEX_FIRST];
7474
}
7575
}
7676
}

BunqSdk.Tests/Model/Generated/DraftShareInviteBankQrCodeContentTest.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ public void TestCreateInviteBankAndGetQrCode()
4040
{
4141
var draftId = GetShareInviteId();
4242

43-
var qrContent = DraftShareInviteBankQrCodeContent.List(API_CONTEXT, USER_ID, draftId);
43+
var qrContent = DraftShareInviteBankQrCodeContent.List(API_CONTEXT, USER_ID, draftId).Value;
4444

4545
var fileOut = new FileInfo(FILENAME_QR_CODE_IMAGE);
4646
fileOut.Directory.Create();
@@ -62,7 +62,7 @@ private static int GetShareInviteId()
6262
{DraftShareInviteBank.FIELD_EXPIRATION, expirationTime}
6363
};
6464

65-
return DraftShareInviteBank.Create(API_CONTEXT, requestMap, USER_ID);
65+
return DraftShareInviteBank.Create(API_CONTEXT, requestMap, USER_ID).Value;
6666
}
6767
}
6868
}

BunqSdk.Tests/Model/Generated/MonetaryAccountBankTest.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ public void TestCreationNewMonetaryAccount()
3939
{MonetaryAccountBank.FIELD_CURRENCY, CURRENCY},
4040
{MonetaryAccountBank.FIELD_DESCRIPTION, MONETARY_ACCOUNT_DESCRIPTION}
4141
};
42-
var monetaryAccountToCloseId = MonetaryAccountBank.Create(API_CONTEXT, requestMap, USER_ID);
42+
var monetaryAccountToCloseId = MonetaryAccountBank.Create(API_CONTEXT, requestMap, USER_ID).Value;
4343

4444
DeleteMonetaryAccount(monetaryAccountToCloseId);
4545
}

BunqSdk.Tests/Model/Generated/PaymentChatTest.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,14 +38,14 @@ public class PaymentChatTest : BunqSdkTestBase
3838
public void TestSendPaymentChat()
3939
{
4040
var paymentChatMap = new Dictionary<string, object>();
41-
var cahtId = PaymentChat.Create(API_CONTEXT, paymentChatMap, USER_ID, MONETARTY_ACCOUNT_ID,
42-
CreatePaymentAndGetId());
41+
var chatId = PaymentChat.Create(API_CONTEXT, paymentChatMap, USER_ID, MONETARTY_ACCOUNT_ID,
42+
CreatePaymentAndGetId()).Value;
4343

4444
var chatMessageMap = new Dictionary<string, object>
4545
{
4646
{ChatMessageText.FIELD_TEXT, MESSAGE_TEXT}
4747
};
48-
ChatMessageText.Create(API_CONTEXT, chatMessageMap, USER_ID, cahtId);
48+
ChatMessageText.Create(API_CONTEXT, chatMessageMap, USER_ID, chatId);
4949
}
5050

5151
private static int CreatePaymentAndGetId()
@@ -57,7 +57,7 @@ private static int CreatePaymentAndGetId()
5757
{Payment.FIELD_DESCRIPTION, PAYMENT_DESCRIPTION},
5858
};
5959

60-
return Payment.Create(API_CONTEXT, requestMap, USER_ID, MONETARTY_ACCOUNT_ID);
60+
return Payment.Create(API_CONTEXT, requestMap, USER_ID, MONETARTY_ACCOUNT_ID).Value;
6161
}
6262
}
6363
}

BunqSdk.Tests/Model/Generated/RequestInquiryTest.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,15 +54,15 @@ public void TestRequestInquiry()
5454
private static string AcceptRequest()
5555
{
5656
var requestResponseId = RequestResponse
57-
.List(API_CONTEXT, USER_ID, SECOND_MONETARY_ACCOUNT_ID)[INDEX_FIRST].Id.Value;
57+
.List(API_CONTEXT, USER_ID, SECOND_MONETARY_ACCOUNT_ID).Value[INDEX_FIRST].Id.Value;
5858

5959
var requestMap = new Dictionary<string, object>
6060
{
6161
{RequestResponse.FIELD_STATUS, FIELD_STATUS}
6262
};
6363

6464
return RequestResponse.Update(API_CONTEXT, requestMap, USER_ID, SECOND_MONETARY_ACCOUNT_ID,
65-
requestResponseId).Status;
65+
requestResponseId).Value.Status;
6666
}
6767
}
6868
}

BunqSdk.Tests/Model/Generated/TabUsageSingleTest.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ private static string CreateTabAndGetUuid()
6868
};
6969

7070
return TabUsageSingle.Create(API_CONTEXT, createTabMap, USER_ID, MONETARY_ACCOUNT_ID,
71-
CASH_REGISTER_ID);
71+
CASH_REGISTER_ID).Value;
7272
}
7373

7474
private static void AddTabItem(string tabUuid)

0 commit comments

Comments
 (0)