@@ -15,19 +15,20 @@ public void FieldRoundtrip_Works()
1515 {
1616 AccountID = "account_in71c4amph0vgo2qllky" ,
1717 Name = "Rent payments" ,
18- InboundAch = new ( DebitStatus . Allowed ) ,
19- InboundChecks = new ( Status . Allowed ) ,
18+ InboundAchDebits = InboundAchDebits . Allowed ,
19+ UnregisteredInboundChecks = UnregisteredInboundChecks . Allowed ,
2020 } ;
2121
2222 string expectedAccountID = "account_in71c4amph0vgo2qllky" ;
2323 string expectedName = "Rent payments" ;
24- InboundAch expectedInboundAch = new ( DebitStatus . Allowed ) ;
25- InboundChecks expectedInboundChecks = new ( Status . Allowed ) ;
24+ ApiEnum < string , InboundAchDebits > expectedInboundAchDebits = InboundAchDebits . Allowed ;
25+ ApiEnum < string , UnregisteredInboundChecks > expectedUnregisteredInboundChecks =
26+ UnregisteredInboundChecks . Allowed ;
2627
2728 Assert . Equal ( expectedAccountID , parameters . AccountID ) ;
2829 Assert . Equal ( expectedName , parameters . Name ) ;
29- Assert . Equal ( expectedInboundAch , parameters . InboundAch ) ;
30- Assert . Equal ( expectedInboundChecks , parameters . InboundChecks ) ;
30+ Assert . Equal ( expectedInboundAchDebits , parameters . InboundAchDebits ) ;
31+ Assert . Equal ( expectedUnregisteredInboundChecks , parameters . UnregisteredInboundChecks ) ;
3132 }
3233
3334 [ Fact ]
@@ -39,10 +40,10 @@ public void OptionalNonNullableParamsUnsetAreNotSet_Works()
3940 Name = "Rent payments" ,
4041 } ;
4142
42- Assert . Null ( parameters . InboundAch ) ;
43- Assert . False ( parameters . RawBodyData . ContainsKey ( "inbound_ach " ) ) ;
44- Assert . Null ( parameters . InboundChecks ) ;
45- Assert . False ( parameters . RawBodyData . ContainsKey ( "inbound_checks " ) ) ;
43+ Assert . Null ( parameters . InboundAchDebits ) ;
44+ Assert . False ( parameters . RawBodyData . ContainsKey ( "inbound_ach_debits " ) ) ;
45+ Assert . Null ( parameters . UnregisteredInboundChecks ) ;
46+ Assert . False ( parameters . RawBodyData . ContainsKey ( "unregistered_inbound_checks " ) ) ;
4647 }
4748
4849 [ Fact ]
@@ -54,14 +55,14 @@ public void OptionalNonNullableParamsSetToNullAreNotSet_Works()
5455 Name = "Rent payments" ,
5556
5657 // Null should be interpreted as omitted for these properties
57- InboundAch = null ,
58- InboundChecks = null ,
58+ InboundAchDebits = null ,
59+ UnregisteredInboundChecks = null ,
5960 } ;
6061
61- Assert . Null ( parameters . InboundAch ) ;
62- Assert . False ( parameters . RawBodyData . ContainsKey ( "inbound_ach " ) ) ;
63- Assert . Null ( parameters . InboundChecks ) ;
64- Assert . False ( parameters . RawBodyData . ContainsKey ( "inbound_checks " ) ) ;
62+ Assert . Null ( parameters . InboundAchDebits ) ;
63+ Assert . False ( parameters . RawBodyData . ContainsKey ( "inbound_ach_debits " ) ) ;
64+ Assert . Null ( parameters . UnregisteredInboundChecks ) ;
65+ Assert . False ( parameters . RawBodyData . ContainsKey ( "unregistered_inbound_checks " ) ) ;
6566 }
6667
6768 [ Fact ]
@@ -85,8 +86,8 @@ public void CopyConstructor_Works()
8586 {
8687 AccountID = "account_in71c4amph0vgo2qllky" ,
8788 Name = "Rent payments" ,
88- InboundAch = new ( DebitStatus . Allowed ) ,
89- InboundChecks = new ( Status . Allowed ) ,
89+ InboundAchDebits = InboundAchDebits . Allowed ,
90+ UnregisteredInboundChecks = UnregisteredInboundChecks . Allowed ,
9091 } ;
9192
9293 AccountNumberCreateParams copied = new ( parameters ) ;
@@ -95,84 +96,22 @@ public void CopyConstructor_Works()
9596 }
9697}
9798
98- public class InboundAchTest : TestBase
99- {
100- [ Fact ]
101- public void FieldRoundtrip_Works ( )
102- {
103- var model = new InboundAch { DebitStatus = DebitStatus . Allowed } ;
104-
105- ApiEnum < string , DebitStatus > expectedDebitStatus = DebitStatus . Allowed ;
106-
107- Assert . Equal ( expectedDebitStatus , model . DebitStatus ) ;
108- }
109-
110- [ Fact ]
111- public void SerializationRoundtrip_Works ( )
112- {
113- var model = new InboundAch { DebitStatus = DebitStatus . Allowed } ;
114-
115- string json = JsonSerializer . Serialize ( model , ModelBase . SerializerOptions ) ;
116- var deserialized = JsonSerializer . Deserialize < InboundAch > (
117- json ,
118- ModelBase . SerializerOptions
119- ) ;
120-
121- Assert . Equal ( model , deserialized ) ;
122- }
123-
124- [ Fact ]
125- public void FieldRoundtripThroughSerialization_Works ( )
126- {
127- var model = new InboundAch { DebitStatus = DebitStatus . Allowed } ;
128-
129- string element = JsonSerializer . Serialize ( model , ModelBase . SerializerOptions ) ;
130- var deserialized = JsonSerializer . Deserialize < InboundAch > (
131- element ,
132- ModelBase . SerializerOptions
133- ) ;
134- Assert . NotNull ( deserialized ) ;
135-
136- ApiEnum < string , DebitStatus > expectedDebitStatus = DebitStatus . Allowed ;
137-
138- Assert . Equal ( expectedDebitStatus , deserialized . DebitStatus ) ;
139- }
140-
141- [ Fact ]
142- public void Validation_Works ( )
143- {
144- var model = new InboundAch { DebitStatus = DebitStatus . Allowed } ;
145-
146- model . Validate ( ) ;
147- }
148-
149- [ Fact ]
150- public void CopyConstructor_Works ( )
151- {
152- var model = new InboundAch { DebitStatus = DebitStatus . Allowed } ;
153-
154- InboundAch copied = new ( model ) ;
155-
156- Assert . Equal ( model , copied ) ;
157- }
158- }
159-
160- public class DebitStatusTest : TestBase
99+ public class InboundAchDebitsTest : TestBase
161100{
162101 [ Theory ]
163- [ InlineData ( DebitStatus . Allowed ) ]
164- [ InlineData ( DebitStatus . Blocked ) ]
165- public void Validation_Works ( DebitStatus rawValue )
102+ [ InlineData ( InboundAchDebits . Allowed ) ]
103+ [ InlineData ( InboundAchDebits . Blocked ) ]
104+ public void Validation_Works ( InboundAchDebits rawValue )
166105 {
167106 // force implicit conversion because Theory can't do that for us
168- ApiEnum < string , DebitStatus > value = rawValue ;
107+ ApiEnum < string , InboundAchDebits > value = rawValue ;
169108 value . Validate ( ) ;
170109 }
171110
172111 [ Fact ]
173112 public void InvalidEnumValidationThrows_Works ( )
174113 {
175- var value = JsonSerializer . Deserialize < ApiEnum < string , DebitStatus > > (
114+ var value = JsonSerializer . Deserialize < ApiEnum < string , InboundAchDebits > > (
176115 JsonSerializer . SerializeToElement ( "invalid value" ) ,
177116 ModelBase . SerializerOptions
178117 ) ;
@@ -182,15 +121,15 @@ public void InvalidEnumValidationThrows_Works()
182121 }
183122
184123 [ Theory ]
185- [ InlineData ( DebitStatus . Allowed ) ]
186- [ InlineData ( DebitStatus . Blocked ) ]
187- public void SerializationRoundtrip_Works ( DebitStatus rawValue )
124+ [ InlineData ( InboundAchDebits . Allowed ) ]
125+ [ InlineData ( InboundAchDebits . Blocked ) ]
126+ public void SerializationRoundtrip_Works ( InboundAchDebits rawValue )
188127 {
189128 // force implicit conversion because Theory can't do that for us
190- ApiEnum < string , DebitStatus > value = rawValue ;
129+ ApiEnum < string , InboundAchDebits > value = rawValue ;
191130
192131 string json = JsonSerializer . Serialize ( value , ModelBase . SerializerOptions ) ;
193- var deserialized = JsonSerializer . Deserialize < ApiEnum < string , DebitStatus > > (
132+ var deserialized = JsonSerializer . Deserialize < ApiEnum < string , InboundAchDebits > > (
194133 json ,
195134 ModelBase . SerializerOptions
196135 ) ;
@@ -201,12 +140,12 @@ public void SerializationRoundtrip_Works(DebitStatus rawValue)
201140 [ Fact ]
202141 public void InvalidEnumSerializationRoundtrip_Works ( )
203142 {
204- var value = JsonSerializer . Deserialize < ApiEnum < string , DebitStatus > > (
143+ var value = JsonSerializer . Deserialize < ApiEnum < string , InboundAchDebits > > (
205144 JsonSerializer . SerializeToElement ( "invalid value" ) ,
206145 ModelBase . SerializerOptions
207146 ) ;
208147 string json = JsonSerializer . Serialize ( value , ModelBase . SerializerOptions ) ;
209- var deserialized = JsonSerializer . Deserialize < ApiEnum < string , DebitStatus > > (
148+ var deserialized = JsonSerializer . Deserialize < ApiEnum < string , InboundAchDebits > > (
210149 json ,
211150 ModelBase . SerializerOptions
212151 ) ;
@@ -215,84 +154,22 @@ public void InvalidEnumSerializationRoundtrip_Works()
215154 }
216155}
217156
218- public class InboundChecksTest : TestBase
219- {
220- [ Fact ]
221- public void FieldRoundtrip_Works ( )
222- {
223- var model = new InboundChecks { Status = Status . Allowed } ;
224-
225- ApiEnum < string , Status > expectedStatus = Status . Allowed ;
226-
227- Assert . Equal ( expectedStatus , model . Status ) ;
228- }
229-
230- [ Fact ]
231- public void SerializationRoundtrip_Works ( )
232- {
233- var model = new InboundChecks { Status = Status . Allowed } ;
234-
235- string json = JsonSerializer . Serialize ( model , ModelBase . SerializerOptions ) ;
236- var deserialized = JsonSerializer . Deserialize < InboundChecks > (
237- json ,
238- ModelBase . SerializerOptions
239- ) ;
240-
241- Assert . Equal ( model , deserialized ) ;
242- }
243-
244- [ Fact ]
245- public void FieldRoundtripThroughSerialization_Works ( )
246- {
247- var model = new InboundChecks { Status = Status . Allowed } ;
248-
249- string element = JsonSerializer . Serialize ( model , ModelBase . SerializerOptions ) ;
250- var deserialized = JsonSerializer . Deserialize < InboundChecks > (
251- element ,
252- ModelBase . SerializerOptions
253- ) ;
254- Assert . NotNull ( deserialized ) ;
255-
256- ApiEnum < string , Status > expectedStatus = Status . Allowed ;
257-
258- Assert . Equal ( expectedStatus , deserialized . Status ) ;
259- }
260-
261- [ Fact ]
262- public void Validation_Works ( )
263- {
264- var model = new InboundChecks { Status = Status . Allowed } ;
265-
266- model . Validate ( ) ;
267- }
268-
269- [ Fact ]
270- public void CopyConstructor_Works ( )
271- {
272- var model = new InboundChecks { Status = Status . Allowed } ;
273-
274- InboundChecks copied = new ( model ) ;
275-
276- Assert . Equal ( model , copied ) ;
277- }
278- }
279-
280- public class StatusTest : TestBase
157+ public class UnregisteredInboundChecksTest : TestBase
281158{
282159 [ Theory ]
283- [ InlineData ( Status . Allowed ) ]
284- [ InlineData ( Status . CheckTransfersOnly ) ]
285- public void Validation_Works ( Status rawValue )
160+ [ InlineData ( UnregisteredInboundChecks . Allowed ) ]
161+ [ InlineData ( UnregisteredInboundChecks . Blocked ) ]
162+ public void Validation_Works ( UnregisteredInboundChecks rawValue )
286163 {
287164 // force implicit conversion because Theory can't do that for us
288- ApiEnum < string , Status > value = rawValue ;
165+ ApiEnum < string , UnregisteredInboundChecks > value = rawValue ;
289166 value . Validate ( ) ;
290167 }
291168
292169 [ Fact ]
293170 public void InvalidEnumValidationThrows_Works ( )
294171 {
295- var value = JsonSerializer . Deserialize < ApiEnum < string , Status > > (
172+ var value = JsonSerializer . Deserialize < ApiEnum < string , UnregisteredInboundChecks > > (
296173 JsonSerializer . SerializeToElement ( "invalid value" ) ,
297174 ModelBase . SerializerOptions
298175 ) ;
@@ -302,15 +179,15 @@ public void InvalidEnumValidationThrows_Works()
302179 }
303180
304181 [ Theory ]
305- [ InlineData ( Status . Allowed ) ]
306- [ InlineData ( Status . CheckTransfersOnly ) ]
307- public void SerializationRoundtrip_Works ( Status rawValue )
182+ [ InlineData ( UnregisteredInboundChecks . Allowed ) ]
183+ [ InlineData ( UnregisteredInboundChecks . Blocked ) ]
184+ public void SerializationRoundtrip_Works ( UnregisteredInboundChecks rawValue )
308185 {
309186 // force implicit conversion because Theory can't do that for us
310- ApiEnum < string , Status > value = rawValue ;
187+ ApiEnum < string , UnregisteredInboundChecks > value = rawValue ;
311188
312189 string json = JsonSerializer . Serialize ( value , ModelBase . SerializerOptions ) ;
313- var deserialized = JsonSerializer . Deserialize < ApiEnum < string , Status > > (
190+ var deserialized = JsonSerializer . Deserialize < ApiEnum < string , UnregisteredInboundChecks > > (
314191 json ,
315192 ModelBase . SerializerOptions
316193 ) ;
@@ -321,12 +198,12 @@ public void SerializationRoundtrip_Works(Status rawValue)
321198 [ Fact ]
322199 public void InvalidEnumSerializationRoundtrip_Works ( )
323200 {
324- var value = JsonSerializer . Deserialize < ApiEnum < string , Status > > (
201+ var value = JsonSerializer . Deserialize < ApiEnum < string , UnregisteredInboundChecks > > (
325202 JsonSerializer . SerializeToElement ( "invalid value" ) ,
326203 ModelBase . SerializerOptions
327204 ) ;
328205 string json = JsonSerializer . Serialize ( value , ModelBase . SerializerOptions ) ;
329- var deserialized = JsonSerializer . Deserialize < ApiEnum < string , Status > > (
206+ var deserialized = JsonSerializer . Deserialize < ApiEnum < string , UnregisteredInboundChecks > > (
330207 json ,
331208 ModelBase . SerializerOptions
332209 ) ;
0 commit comments