Skip to content

Commit 17d446c

Browse files
author
antao
committed
Rename constants following PascalCase convention. (#58)
1 parent 9b16490 commit 17d446c

File tree

11 files changed

+200
-206
lines changed

11 files changed

+200
-206
lines changed

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

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -17,16 +17,16 @@ public class AttachmentPublicTest : BunqSdkTestBase
1717
/// <summary>
1818
/// Config values.
1919
/// </summary>
20-
private const string PATH_ATTACHMENT = "../../../Resources";
20+
private const string PathAttachment = "../../../Resources";
2121

22-
private static readonly string CONTENT_TYPE = Config.GetAttachmentContentType();
23-
private static readonly string ATTACHMENT_DESCRIPTION = Config.GetAttachmentDescrpition();
24-
private static readonly string ATTACHMENT_PATH_IN = Config.GetAttachmentPathIn();
22+
private static readonly string ContentType = Config.GetAttachmentContentType();
23+
private static readonly string AttachmentDescription = Config.GetAttachmentDescrpition();
24+
private static readonly string AttachmentPathIn = Config.GetAttachmentPathIn();
2525

2626
/// <summary>
2727
/// API context to use for the test API calls.
2828
/// </summary>
29-
private static readonly ApiContext API_CONTEXT = GetApiContext();
29+
private static readonly ApiContext ApiContext = GetApiContext();
3030

3131
/// <summary>
3232
/// Tests if the file we upload is the file we are getting back once successfully uploaded does.
@@ -35,15 +35,15 @@ public class AttachmentPublicTest : BunqSdkTestBase
3535
[Fact]
3636
public void TestAttachmentUploadAndRetrieval()
3737
{
38-
var fileContentBytes = File.ReadAllBytes(PATH_ATTACHMENT + ATTACHMENT_PATH_IN);
38+
var fileContentBytes = File.ReadAllBytes(PathAttachment + AttachmentPathIn);
3939
var customHeaders = new Dictionary<string, string>
4040
{
41-
{ApiClient.HeaderContentType, CONTENT_TYPE},
42-
{ApiClient.HeaderAttachmentDescription, ATTACHMENT_DESCRIPTION}
41+
{ApiClient.HeaderContentType, ContentType},
42+
{ApiClient.HeaderAttachmentDescription, AttachmentDescription}
4343
};
4444

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

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

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

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -18,17 +18,17 @@ public class AvatarTest : BunqSdkTestBase
1818
/// <summary>
1919
/// Config values.
2020
/// </summary>
21-
private const string PATH_TO_ATTACHMENT = "../../../Resources";
22-
private const int INDEX_FIRST = 0;
21+
private const string PathToAttachment = "../../../Resources";
22+
private const int IndexFirst = 0;
2323

24-
private static readonly string CONTEN_TYPE = Config.GetAttachmentContentType();
25-
private static readonly string ATTACHMENT_DECSRIPTION = Config.GetAttachmentDescrpition();
26-
private static readonly string ATTACHMENT_PATH_IN = Config.GetAttachmentPathIn();
24+
private static readonly string ContentType = Config.GetAttachmentContentType();
25+
private static readonly string AttachmentDescription = Config.GetAttachmentDescrpition();
26+
private static readonly string AttachmentPathIn = Config.GetAttachmentPathIn();
2727

2828
/// <summary>
2929
/// API context to use for the test API calls.
3030
/// </summary>
31-
private static readonly ApiContext API_CONTEXT = GetApiContext();
31+
private static readonly ApiContext ApiContext = GetApiContext();
3232

3333
/// <summary>
3434
/// Tests the creation of an avatar by uploading a picture via AttachmentPublic and setting it as avatar
@@ -37,18 +37,18 @@ public class AvatarTest : BunqSdkTestBase
3737
[Fact]
3838
public void TestCreateAvatarAndRetrieval()
3939
{
40-
var fileContentByte = File.ReadAllBytes(PATH_TO_ATTACHMENT + ATTACHMENT_PATH_IN);
40+
var fileContentByte = File.ReadAllBytes(PathToAttachment + AttachmentPathIn);
4141
var attachmentUuid = UploadAvatarAndGetUuid(fileContentByte);
4242

4343
var avatarMap = new Dictionary<string, object>
4444
{
4545
{Avatar.FIELD_ATTACHMENT_PUBLIC_UUID, attachmentUuid}
4646
};
47-
var avatarUuid = Avatar.Create(API_CONTEXT, avatarMap).Value;
47+
var avatarUuid = Avatar.Create(ApiContext, avatarMap).Value;
4848

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

5353
Assert.Equal(attachmentUuid, attachmentUuidFromAvatar);
5454
Assert.Equal(fileContentByte, revievedFileContentByte);
@@ -58,11 +58,11 @@ private static string UploadAvatarAndGetUuid(byte[] fileContentByte)
5858
{
5959
var customHeaders = new Dictionary<string, string>
6060
{
61-
{ApiClient.HeaderAttachmentDescription, ATTACHMENT_DECSRIPTION},
62-
{ApiClient.HeaderContentType, CONTEN_TYPE},
61+
{ApiClient.HeaderAttachmentDescription, AttachmentDescription},
62+
{ApiClient.HeaderContentType, ContentType},
6363
};
6464

65-
return AttachmentPublic.Create(API_CONTEXT, fileContentByte, customHeaders).Value;
65+
return AttachmentPublic.Create(ApiContext, fileContentByte, customHeaders).Value;
6666
}
6767
}
6868
}

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

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -17,19 +17,19 @@ public class CardDebitTest : BunqSdkTestBase
1717
/// <summary>
1818
/// Config values.
1919
/// </summary>
20-
private const string PIN_CODE = "4045";
21-
private const int INDEX_FIRST = 0;
22-
private const int NONNEGATIVE_INTEGER_MINIMUM = 0;
23-
private const int BASE_DECIMAL = 10;
24-
private const int CARD_SECOND_LINE_LENGTH_MAXIMUM = 20;
25-
private const int NUMBER_ONE = 1;
20+
private const string PinCode = "4045";
21+
private const int IndexFirst = 0;
22+
private const int NonNegativeIntegerMinimum = 0;
23+
private const int BaseDecimal = 10;
24+
private const int CardSecondLineLengthMaximum = 20;
25+
private const int NumberOne = 1;
2626

27-
private static readonly int USER_ID = Config.GetUserId();
27+
private static readonly int UserId = Config.GetUserId();
2828

2929
/// <summary>
3030
/// API context used to for the test API calls.
3131
/// </summary>
32-
private static readonly ApiContext API_CONTEXT = GetApiContext();
32+
private static readonly ApiContext ApiContext = GetApiContext();
3333

3434
/// <summary>
3535
/// Tests ordering a new card and checks if the fields we have entered are indeed correct by.
@@ -41,12 +41,12 @@ public void TestOrderNewMaestroCard()
4141
{
4242
{CardDebit.FIELD_ALIAS, GetAlias()},
4343
{CardDebit.FIELD_NAME_ON_CARD, GetAnAllowedName()},
44-
{CardDebit.FIELD_PIN_CODE, PIN_CODE},
44+
{CardDebit.FIELD_PIN_CODE, PinCode},
4545
{CardDebit.FIELD_SECOND_LINE, GenerateRandomSecondLine()}
4646
};
47-
var cardDebit = CardDebit.Create(API_CONTEXT, cardDebitMap, USER_ID).Value;
47+
var cardDebit = CardDebit.Create(ApiContext, cardDebitMap, UserId).Value;
4848

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

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

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

6161
private static string GenerateRandomSecondLine()
6262
{
6363
var random = new Random();
6464

6565
return random.Next(
66-
NONNEGATIVE_INTEGER_MINIMUM,
67-
(int) Math.Pow(BASE_DECIMAL, CARD_SECOND_LINE_LENGTH_MAXIMUM + NUMBER_ONE) - NUMBER_ONE
66+
NonNegativeIntegerMinimum,
67+
(int) Math.Pow(BaseDecimal, CardSecondLineLengthMaximum + NumberOne) - NumberOne
6868
).ToString();
6969
}
7070

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

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

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -18,17 +18,17 @@ public class DraftShareInviteBankQrCodeContentTest : BunqSdkTestBase
1818
/// <summary>
1919
/// Config values.
2020
/// </summary>
21-
private const string FILENAME_QR_CODE_IMAGE = "tmp/qrcode.png";
22-
private const int TIME_UNIT_AMOUNT_ZERO = 0;
23-
private const int TIME_UNIT_AMOUNT_ONE = 1;
24-
private const string FORMAT_DATE = "yyyy-MM-dd HH:mm:ss";
21+
private const string FilenameQrCodeImage = "tmp/qrcode.png";
22+
private const int TimeUnitAmountZero = 0;
23+
private const int TimeUnitAmountOne = 1;
24+
private const string FormatDate = "yyyy-MM-dd HH:mm:ss";
2525

26-
private static readonly int USER_ID = Config.GetUserId();
26+
private static readonly int UserId = Config.GetUserId();
2727

2828
/// <summary>
2929
/// API context to use for the test API calls
3030
/// </summary>
31-
private static readonly ApiContext API_CONTEXT = GetApiContext();
31+
private static readonly ApiContext ApiContext = GetApiContext();
3232

3333
/// <summary>
3434
/// Tests the creation of a connect and getting the qr code related to this connect.
@@ -40,18 +40,18 @@ public void TestCreateInviteBankAndGetQrCode()
4040
{
4141
var draftId = GetShareInviteId();
4242

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

45-
var fileOut = new FileInfo(FILENAME_QR_CODE_IMAGE);
45+
var fileOut = new FileInfo(FilenameQrCodeImage);
4646
fileOut.Directory.Create();
4747
File.WriteAllBytes(fileOut.FullName, qrContent);
4848
}
4949

5050
private static int GetShareInviteId()
5151
{
5252
var currentDate = DateTime.UtcNow.Date;
53-
var addTime = new TimeSpan(TIME_UNIT_AMOUNT_ZERO, TIME_UNIT_AMOUNT_ONE, TIME_UNIT_AMOUNT_ZERO);
54-
var expirationTime = currentDate.Add(addTime).ToString(FORMAT_DATE);
53+
var addTime = new TimeSpan(TimeUnitAmountZero, TimeUnitAmountOne, TimeUnitAmountZero);
54+
var expirationTime = currentDate.Add(addTime).ToString(FormatDate);
5555

5656
var draftShareInviteBankEntry = new DraftShareInviteBankEntry(new ShareDetail
5757
{Payment = new ShareDetailPayment(true, true, true, true)});
@@ -62,7 +62,7 @@ private static int GetShareInviteId()
6262
{DraftShareInviteBank.FIELD_EXPIRATION, expirationTime}
6363
};
6464

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

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

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -14,19 +14,19 @@ public class MonetaryAccountBankTest : BunqSdkTestBase
1414
/// <summary>
1515
/// Config values
1616
/// </summary>
17-
private const string STATUS = "CANCELLED";
18-
private const string SUBS_STATUS = "REDEMPTION_VOLUNTARY";
19-
private const string REASON = "OTHER";
20-
private const string REASON_DESCRIPTION = "Because this is a test";
21-
private const string CURRENCY = "EUR";
22-
private const string MONETARY_ACCOUNT_DESCRIPTION = "Test C# monetary account";
17+
private const string Status = "CANCELLED";
18+
private const string SubStatus = "REDEMPTION_VOLUNTARY";
19+
private const string Reason = "OTHER";
20+
private const string ReasonDescription = "Because this is a test";
21+
private const string Currency = "EUR";
22+
private const string Description = "Test C# monetary account";
2323

24-
private static readonly int USER_ID = Config.GetUserId();
24+
private static readonly int UserId = Config.GetUserId();
2525

2626
/// <summary>
2727
/// API context used for the test API calls.
2828
/// </summary>
29-
private static readonly ApiContext API_CONTEXT = GetApiContext();
29+
private static readonly ApiContext ApiContext = GetApiContext();
3030

3131
/// <summary>
3232
/// Tests the creation of a new monetary account. This accoult will then be removed afterwards.
@@ -36,10 +36,10 @@ public void TestCreationNewMonetaryAccount()
3636
{
3737
var requestMap = new Dictionary<string, object>
3838
{
39-
{MonetaryAccountBank.FIELD_CURRENCY, CURRENCY},
40-
{MonetaryAccountBank.FIELD_DESCRIPTION, MONETARY_ACCOUNT_DESCRIPTION}
39+
{MonetaryAccountBank.FIELD_CURRENCY, Currency},
40+
{MonetaryAccountBank.FIELD_DESCRIPTION, Description}
4141
};
42-
var monetaryAccountToCloseId = MonetaryAccountBank.Create(API_CONTEXT, requestMap, USER_ID).Value;
42+
var monetaryAccountToCloseId = MonetaryAccountBank.Create(ApiContext, requestMap, UserId).Value;
4343

4444
DeleteMonetaryAccount(monetaryAccountToCloseId);
4545
}
@@ -48,12 +48,12 @@ private static void DeleteMonetaryAccount(int idToClose)
4848
{
4949
var requestMap = new Dictionary<string, object>
5050
{
51-
{MonetaryAccountBank.FIELD_STATUS, STATUS},
52-
{MonetaryAccountBank.FIELD_SUB_STATUS, SUBS_STATUS},
53-
{MonetaryAccountBank.FIELD_REASON, REASON},
54-
{MonetaryAccountBank.FIELD_REASON_DESCRIPTION, REASON_DESCRIPTION}
51+
{MonetaryAccountBank.FIELD_STATUS, Status},
52+
{MonetaryAccountBank.FIELD_SUB_STATUS, SubStatus},
53+
{MonetaryAccountBank.FIELD_REASON, Reason},
54+
{MonetaryAccountBank.FIELD_REASON_DESCRIPTION, ReasonDescription}
5555
};
56-
MonetaryAccountBank.Update(API_CONTEXT, requestMap, USER_ID, idToClose);
56+
MonetaryAccountBank.Update(ApiContext, requestMap, UserId, idToClose);
5757
}
5858
}
5959
}

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

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -17,19 +17,19 @@ public class PaymentChatTest : BunqSdkTestBase
1717
/// <summary>
1818
/// Config values.
1919
/// </summary>
20-
private const string AMOUNT_EUR = "0.01";
21-
private const string CURRENCY = "EUR";
22-
private const string PAYMENT_DESCRIPTION = "Payment From C# Test";
23-
private const string MESSAGE_TEXT = "test msg send from C# test";
20+
private const string Amount = "0.01";
21+
private const string Currency = "EUR";
22+
private const string Description = "Payment From C# Test";
23+
private const string Text = "test msg send from C# test";
2424

25-
private static readonly int USER_ID = Config.GetUserId();
26-
private static readonly int MONETARTY_ACCOUNT_ID = Config.GetMonetarytAccountId();
27-
private static readonly Pointer COUNTER_PARTY_ALIAS = Config.GetCounterPartyAliasSelf();
25+
private static readonly int UserId = Config.GetUserId();
26+
private static readonly int MonetaryAccountId = Config.GetMonetarytAccountId();
27+
private static readonly Pointer CounterPartyAlias = Config.GetCounterPartyAliasSelf();
2828

2929
/// <summary>
3030
/// API context used for the test API calls.
3131
/// </summary>
32-
private static readonly ApiContext API_CONTEXT = GetApiContext();
32+
private static readonly ApiContext ApiContext = GetApiContext();
3333

3434
/// <summary>
3535
/// Tests sending a chat message in a newly created payment.
@@ -38,26 +38,26 @@ public class PaymentChatTest : BunqSdkTestBase
3838
public void TestSendPaymentChat()
3939
{
4040
var paymentChatMap = new Dictionary<string, object>();
41-
var chatId = PaymentChat.Create(API_CONTEXT, paymentChatMap, USER_ID, MONETARTY_ACCOUNT_ID,
41+
var chatId = PaymentChat.Create(ApiContext, paymentChatMap, UserId, MonetaryAccountId,
4242
CreatePaymentAndGetId()).Value;
4343

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

5151
private static int CreatePaymentAndGetId()
5252
{
5353
var requestMap = new Dictionary<string, object>
5454
{
55-
{Payment.FIELD_AMOUNT, new Amount(AMOUNT_EUR, CURRENCY)},
56-
{Payment.FIELD_COUNTERPARTY_ALIAS, COUNTER_PARTY_ALIAS},
57-
{Payment.FIELD_DESCRIPTION, PAYMENT_DESCRIPTION},
55+
{Payment.FIELD_AMOUNT, new Amount(Amount, Currency)},
56+
{Payment.FIELD_COUNTERPARTY_ALIAS, CounterPartyAlias},
57+
{Payment.FIELD_DESCRIPTION, Description},
5858
};
5959

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

0 commit comments

Comments
 (0)