1- using System . Collections . Generic ;
2- using System . IO ;
1+ using System . IO ;
32using System . Linq ;
43using System . Net . Http ;
4+ using System . Threading ;
55using Bunq . Sdk . Context ;
66using Bunq . Sdk . Exception ;
77using Bunq . Sdk . Json ;
@@ -37,39 +37,39 @@ public class BunqSdkTestBase
3737 /// Constants for monetary account.
3838 /// </summary>
3939 protected const string MonetaryAccountDescription = "Test C# monetary account" ;
40-
40+
4141 /// <summary>
4242 /// Image constants.
4343 /// </summary>
4444 protected const string PathAttachment = "../../../Resources" ;
4545 protected const string ContentType = "image/png" ;
4646 protected const string AttachmentDescription = "C# sdk image test." ;
4747 protected const string AttachmentPathIn = "/vader.png" ;
48-
48+
4949 /// <summary>
5050 /// Device registration constants.
5151 /// </summary>
5252 private const string DeviceDescription = "Csharp test device" ;
53-
53+
5454 /// <summary>
5555 /// Pointer type constants.
5656 /// </summary>
5757 private const string PointerTypeEmail = "EMAIL" ;
58-
58+
5959 /// <summary>
6060 /// Email constants.
6161 /// </summary>
6262 private const string EmailBravo = "[email protected] " ; 6363 private const string EmailSuggarDaddy = "[email protected] " ; 64-
64+
6565 /// <summary>
6666 /// Spending money constants.
6767 /// </summary>
6868 private const string SpendingMoneyAmount = "50.00" ;
6969 private const string SpendingMoneyRequestDescription = "sdk c# test, thanks daddy." ;
7070
7171 protected static MonetaryAccountBank SecondMonetaryAccountBank ;
72-
72+
7373 /// <summary>
7474 /// Gets an Api Context, re-creates if needed and returns it.
7575 /// </summary>
@@ -78,7 +78,7 @@ protected static void SetUpTestCase()
7878 SetUpApiContext ( ) ;
7979 SecondMonetaryAccountBank = SetUpSecondMonetaryAccount ( ) ;
8080 RequestSpendingMoney ( ) ;
81- System . Threading . Thread . Sleep ( 500 ) ; // ensure requests are auto accepted.
81+ Thread . Sleep ( 500 ) ; // ensure requests are auto accepted.
8282 BunqContext . UserContext . RefreshUserContext ( ) ;
8383 }
8484
@@ -96,12 +96,12 @@ protected static ApiContext SetUpApiContext()
9696 var sandboxUser = GenerateNewSandboxUser ( ) ;
9797 apiContext = ApiContext . Create ( ApiEnvironmentType . SANDBOX , sandboxUser . ApiKey , DeviceDescription ) ;
9898 }
99-
99+
100100 BunqContext . LoadApiContext ( apiContext ) ;
101101
102102 return apiContext ;
103103 }
104-
104+
105105 private static SandboxUser GenerateNewSandboxUser ( )
106106 {
107107 var httpClient = new HttpClient ( ) ;
@@ -117,7 +117,7 @@ private static SandboxUser GenerateNewSandboxUser()
117117
118118 var responseString = requestTask . Result . Content . ReadAsStringAsync ( ) . Result ;
119119 var responseJson = BunqJsonConvert . DeserializeObject < JObject > ( responseString ) ;
120-
120+
121121 return BunqJsonConvert . DeserializeObject < SandboxUser > ( responseJson . First . First . First . First . First
122122 . ToString ( ) ) ;
123123 }
@@ -136,38 +136,38 @@ private static void RequestSpendingMoney()
136136 new Pointer ( PointerTypeEmail , EmailSuggarDaddy ) ,
137137 SpendingMoneyRequestDescription ,
138138 false
139- ) ;
140-
139+ ) ;
140+
141141 RequestInquiry . Create (
142142 new Amount ( SpendingMoneyAmount , PaymentCurrency ) ,
143143 new Pointer ( PointerTypeEmail , EmailSuggarDaddy ) ,
144144 SpendingMoneyRequestDescription ,
145145 false ,
146146 SecondMonetaryAccountBank . Id
147- ) ;
147+ ) ;
148148 }
149149
150150 protected static Pointer GetPointerBravo ( )
151151 {
152152 return new Pointer ( PointerTypeEmail , EmailBravo ) ;
153153 }
154-
154+
155155 protected static Pointer GetAlias ( )
156156 {
157- var userContex = BunqContext . UserContext ;
157+ var userContext = BunqContext . UserContext ;
158158
159- if ( userContex . IsOnlyUserPersonSet ( ) )
159+ if ( userContext . IsOnlyUserPersonSet ( ) )
160160 {
161- return userContex . UserPerson . Alias . First ( ) ;
161+ return userContext . UserPerson . Alias . First ( ) ;
162162 }
163- else if ( userContex . IsOnlyUserCompanySet ( ) )
163+ else if ( userContext . IsOnlyUserCompanySet ( ) )
164164 {
165- return userContex . UserCompany . Alias . First ( ) ;
165+ return userContext . UserCompany . Alias . First ( ) ;
166166 }
167167 else
168168 {
169169 throw new BunqException ( ErrorCouldNotDetermineUserAlias ) ;
170170 }
171171 }
172172 }
173- }
173+ }
0 commit comments