@@ -16,6 +16,7 @@ public class NotificationUrlTest : BunqSdkTestBase
16
16
/// Getter constans.
17
17
/// </summary>
18
18
private const string GetPayment = "Payment" ;
19
+
19
20
private const string GetBunqMeTab = "BunqMeTab" ;
20
21
private const string GetChatMessageAnnouncement = "ChatMessageAnnouncement" ;
21
22
private const string GetChatMessage = "ChatMessage" ;
@@ -30,15 +31,18 @@ public class NotificationUrlTest : BunqSdkTestBase
30
31
private const string GetScheduleInstance = "ScheduledInstance" ;
31
32
private const string GetShareInviteBankInquiry = "ShareInviteBankInquiry" ;
32
33
private const string GetShareInviteBankResponse = "ShareInviteBankResponse" ;
33
-
34
+
34
35
/// <summary>
35
36
/// Model json paths constants.
36
37
/// </summary>
37
38
private const string BasePathJsonModel = "../../../Resources/NotificationUrlJsons" ;
39
+
38
40
private const string JsonPathMutationModel = BasePathJsonModel + "/Mutation.json" ;
39
41
private const string JsonPathBunqMeTabModel = BasePathJsonModel + "/BunqMeTab.json" ;
40
- private const string JsonPathChatMessageAnnouncementModel = BasePathJsonModel +
41
- "/ChatMessageAnnouncement.json" ;
42
+
43
+ private const string JsonPathChatMessageAnnouncementModel = BasePathJsonModel +
44
+ "/ChatMessageAnnouncement.json" ;
45
+
42
46
private const string JsonPathDraftPaymentModel = BasePathJsonModel + "/DraftPayment.json" ;
43
47
private const string JsonPathMasterCardActionModel = BasePathJsonModel + "/MasterCardAction.json" ;
44
48
private const string JsonPathMonetaryAccountBankModel = BasePathJsonModel + "/MonetaryAccountBank.json" ;
@@ -47,10 +51,13 @@ public class NotificationUrlTest : BunqSdkTestBase
47
51
private const string JsonPathRequestResponseModel = BasePathJsonModel + "/RequestResponse.json" ;
48
52
private const string JsonPathSchedulePaymentModel = BasePathJsonModel + "/ScheduledPayment.json" ;
49
53
private const string JsonPathScheduleInstanceModel = BasePathJsonModel + "/ScheduledInstance.json" ;
50
- private const string JsonPathShareInviteBankInquiryModel = BasePathJsonModel +
51
- "/ShareInviteBankInquiry.json" ;
54
+
55
+ private const string JsonPathShareInviteBankInquiryModel = BasePathJsonModel +
56
+ "/ShareInviteBankInquiry.json" ;
57
+
52
58
private const string JsonPathShareInviteBankResponseModel = BasePathJsonModel +
53
- "/ShareInviteBankResponse.json" ;
59
+ "/ShareInviteBankResponse.json" ;
60
+
54
61
/// <summary>
55
62
/// Model root key.
56
63
/// </summary>
@@ -61,19 +68,19 @@ private void ExecuteNotificationUrlTest(
61
68
Type classTypeExpected ,
62
69
string referencedObjectPropertyName ,
63
70
string subClassObjectPropertyName = null ,
64
- Type subClassTypeExpected = null )
71
+ Type subClassTypeExpected = null )
65
72
{
66
73
var jsonString = ReadJsonFromFile ( expectedJsonFileName ) ;
67
74
var notificationUrl = NotificationUrl . CreateFromJsonString ( jsonString ) ;
68
-
75
+
69
76
Assert . NotNull ( notificationUrl ) ;
70
77
Assert . NotNull ( notificationUrl . Object ) ;
71
78
72
79
var model = notificationUrl . Object . GetType ( )
73
80
. GetProperty ( referencedObjectPropertyName )
74
81
. GetValue ( notificationUrl . Object ) ;
75
82
var referencedModel = notificationUrl . Object . GetReferencedObject ( ) ;
76
-
83
+
77
84
Assert . NotNull ( model ) ;
78
85
Assert . NotNull ( referencedModel ) ;
79
86
Assert . IsType ( classTypeExpected , referencedModel ) ;
@@ -82,7 +89,7 @@ private void ExecuteNotificationUrlTest(
82
89
var subClass = referencedModel . GetType ( )
83
90
. GetProperty ( subClassObjectPropertyName )
84
91
. GetValue ( referencedModel ) ;
85
-
92
+
86
93
Assert . NotNull ( subClass ) ;
87
94
Assert . IsType ( subClassTypeExpected , subClass ) ;
88
95
}
@@ -92,7 +99,7 @@ private static string ReadJsonFromFile(string fileName)
92
99
var fileContentString = File . ReadAllText ( fileName ) ;
93
100
var jsonObj = JObject . Parse ( fileContentString ) ;
94
101
var notificationUrlObject = jsonObj [ KeyNotificationUrlModel ] ;
95
-
102
+
96
103
Assert . NotNull ( notificationUrlObject ) ;
97
104
98
105
return notificationUrlObject . ToString ( ) ;
@@ -107,7 +114,7 @@ public void TestMutationModel()
107
114
GetPayment
108
115
) ;
109
116
}
110
-
117
+
111
118
[ Fact ]
112
119
public void TestBunqMeTabModel ( )
113
120
{
@@ -116,8 +123,8 @@ public void TestBunqMeTabModel()
116
123
typeof ( BunqMeTab ) ,
117
124
GetBunqMeTab
118
125
) ;
119
- }
120
-
126
+ }
127
+
121
128
[ Fact ]
122
129
public void TestDraftPaymentModel ( )
123
130
{
@@ -126,8 +133,8 @@ public void TestDraftPaymentModel()
126
133
typeof ( DraftPayment ) ,
127
134
GetDraftPayment
128
135
) ;
129
- }
130
-
136
+ }
137
+
131
138
[ Fact ]
132
139
public void TestMasterCardActionModel ( )
133
140
{
@@ -136,8 +143,8 @@ public void TestMasterCardActionModel()
136
143
typeof ( MasterCardAction ) ,
137
144
GetMasterCardAction
138
145
) ;
139
- }
140
-
146
+ }
147
+
141
148
[ Fact ]
142
149
public void TestMonetaryAccountBankModel ( )
143
150
{
@@ -148,8 +155,8 @@ public void TestMonetaryAccountBankModel()
148
155
GetMonetaryAccountBank ,
149
156
typeof ( MonetaryAccountBank )
150
157
) ;
151
- }
152
-
158
+ }
159
+
153
160
[ Fact ]
154
161
public void TestPaymentBatchModel ( )
155
162
{
@@ -158,8 +165,8 @@ public void TestPaymentBatchModel()
158
165
typeof ( PaymentBatch ) ,
159
166
GetPaymentBatch
160
167
) ;
161
- }
162
-
168
+ }
169
+
163
170
[ Fact ]
164
171
public void TestRequestInquiryModel ( )
165
172
{
@@ -168,8 +175,8 @@ public void TestRequestInquiryModel()
168
175
typeof ( RequestInquiry ) ,
169
176
GetRequestInquiry
170
177
) ;
171
- }
172
-
178
+ }
179
+
173
180
[ Fact ]
174
181
public void TestRequestResponseModel ( )
175
182
{
@@ -178,8 +185,8 @@ public void TestRequestResponseModel()
178
185
typeof ( RequestResponse ) ,
179
186
GetRequestResponse
180
187
) ;
181
- }
182
-
188
+ }
189
+
183
190
[ Fact ]
184
191
public void TestScheduledInstanceModel ( )
185
192
{
@@ -188,8 +195,8 @@ public void TestScheduledInstanceModel()
188
195
typeof ( ScheduleInstance ) ,
189
196
GetScheduleInstance
190
197
) ;
191
- }
192
-
198
+ }
199
+
193
200
[ Fact ]
194
201
public void TestScheduledPaymentModel ( )
195
202
{
@@ -198,8 +205,8 @@ public void TestScheduledPaymentModel()
198
205
typeof ( SchedulePayment ) ,
199
206
GetSchedulePayment
200
207
) ;
201
- }
202
-
208
+ }
209
+
203
210
[ Fact ]
204
211
public void TestShareInviteBankModel ( )
205
212
{
@@ -208,8 +215,8 @@ public void TestShareInviteBankModel()
208
215
typeof ( ShareInviteBankInquiry ) ,
209
216
GetShareInviteBankInquiry
210
217
) ;
211
- }
212
-
218
+ }
219
+
213
220
[ Fact ]
214
221
public void TestShareInviteBankResponse ( )
215
222
{
@@ -220,4 +227,4 @@ public void TestShareInviteBankResponse()
220
227
) ;
221
228
}
222
229
}
223
- }
230
+ }
0 commit comments