3
3
using System . IO ;
4
4
using System . Text ;
5
5
using System . Collections . Generic ;
6
- using ReversoAPI . Web . ConjugationFeature . Domain . Core . Entities ;
7
- using ReversoAPI . Web . ConjugationFeature . Domain . Core . Interfaces . ValueObjects ;
8
6
using ReversoAPI . Web . ConjugationFeature . Domain . Core . Services ;
9
- using ReversoAPI . Web . ConjugationFeature . Domain . Core . ValueObjects ;
10
- using ReversoAPI . Web . Shared . Domain . ValueObjects ;
11
7
12
8
namespace ReversoAPI . Web . Tests . Parsers
13
9
{
@@ -18,7 +14,7 @@ public class ConjugationResponseParserTest
18
14
public void Invoke_Test ( ConjugationData expectedResult , Stream html )
19
15
{
20
16
// Arrange
21
- var parser = new ConjugationParser ( ) ;
17
+ var parser = new ConjugationParserService ( ) ;
22
18
23
19
// Act
24
20
var result = parser . Invoke ( html ) ;
@@ -38,9 +34,9 @@ public static IEnumerable<object[]> HtmlResponsesForTest()
38
34
{
39
35
Text = "run" ,
40
36
Language = Language . English ,
41
- Conjugations = new Dictionary < string , IEnumerable < IConjugation > >
37
+ Conjugations = new Dictionary < string , IEnumerable < Conjugation > >
42
38
{
43
- { "Indicative Present" , new [ ]
39
+ { "Indicative Present" , new [ ]
44
40
{
45
41
new Conjugation ( "Indicative Present" , "run" , Language . English ) ,
46
42
new Conjugation ( "Indicative Present" , "runs" , Language . English ) ,
@@ -78,7 +74,7 @@ public static IEnumerable<object[]> HtmlResponsesForTest()
78
74
{
79
75
Text = "бежать" ,
80
76
Language = Language . Russian ,
81
- Conjugations = new Dictionary < string , IEnumerable < IConjugation > >
77
+ Conjugations = new Dictionary < string , IEnumerable < Conjugation > >
82
78
{
83
79
{ "настоящее" , new [ ]
84
80
{
@@ -138,12 +134,12 @@ public static IEnumerable<object[]> HtmlResponsesForTest()
138
134
} ;
139
135
140
136
yield return new object [ ]
141
- {
137
+ {
142
138
new ConjugationData
143
139
{
144
140
Text = "cair" ,
145
141
Language = Language . Portuguese ,
146
- Conjugations = new Dictionary < string , IEnumerable < IConjugation > >
142
+ Conjugations = new Dictionary < string , IEnumerable < Conjugation > >
147
143
{
148
144
{ "Indicativo Presente" , new [ ]
149
145
{
@@ -298,7 +294,141 @@ public static IEnumerable<object[]> HtmlResponsesForTest()
298
294
}
299
295
} ,
300
296
new MemoryStream ( Encoding . UTF8 . GetBytes ( Resource . Conjugation_Parse_Test_Portuguese ) ) ,
301
- } ;
297
+ } ;
298
+
299
+ yield return new object [ ]
300
+ {
301
+ new ConjugationData
302
+ {
303
+ Text = "逃げる" ,
304
+ Language = Language . Japanese ,
305
+ Conjugations = new Dictionary < string , IEnumerable < Conjugation > >
306
+ {
307
+ { "Present Positive Informal" , new [ ]
308
+ {
309
+ new Conjugation ( "Present Positive Informal" , "逃げる" , Language . Japanese ) ,
310
+ new Conjugation ( "Present Positive Informal" , "逃げます" , Language . Japanese ) ,
311
+ new Conjugation ( "Present Positive Informal" , "逃げない" , Language . Japanese ) ,
312
+ new Conjugation ( "Present Positive Informal" , "逃げません" , Language . Japanese ) ,
313
+ } } ,
314
+ { "Past Positive Informal" , new [ ]
315
+ {
316
+ new Conjugation ( "Past Positive Informal" , "逃げた" , Language . Japanese ) ,
317
+ new Conjugation ( "Past Positive Informal" , "逃げました" , Language . Japanese ) ,
318
+ new Conjugation ( "Past Positive Informal" , "逃げなかった" , Language . Japanese ) ,
319
+ new Conjugation ( "Past Positive Informal" , "逃げませんでした" , Language . Japanese ) ,
320
+ } } ,
321
+ { "Te Form Positive Informal" , new [ ]
322
+ {
323
+ new Conjugation ( "Te Form Positive Informal" , "逃げて" , Language . Japanese ) ,
324
+ new Conjugation ( "Te Form Positive Informal" , "逃げなくて" , Language . Japanese ) ,
325
+ } } ,
326
+ { "Volitional Positive Informal" , new [ ]
327
+ {
328
+ new Conjugation ( "Volitional Positive Informal" , "逃げよう" , Language . Japanese ) ,
329
+ new Conjugation ( "Volitional Positive Informal" , "逃げましょう" , Language . Japanese ) ,
330
+ } } ,
331
+ { "Potential Positive Informal" , new [ ]
332
+ {
333
+ new Conjugation ( "Potential Positive Informal" , "逃げられる" , Language . Japanese ) ,
334
+ new Conjugation ( "Potential Positive Informal" , "逃げられます" , Language . Japanese ) ,
335
+ new Conjugation ( "Potential Positive Informal" , "逃げられない" , Language . Japanese ) ,
336
+ new Conjugation ( "Potential Positive Informal" , "逃げられません" , Language . Japanese ) ,
337
+ } } ,
338
+ { "Passive Positive Informal" , new [ ]
339
+ {
340
+ new Conjugation ( "Passive Positive Informal" , "逃げられる" , Language . Japanese ) ,
341
+ new Conjugation ( "Passive Positive Informal" , "逃げられます" , Language . Japanese ) ,
342
+ new Conjugation ( "Passive Positive Informal" , "逃げられない" , Language . Japanese ) ,
343
+ new Conjugation ( "Passive Positive Informal" , "逃げられません" , Language . Japanese ) ,
344
+ } } ,
345
+ { "Causative Positive Informal" , new [ ]
346
+ {
347
+ new Conjugation ( "Causative Positive Informal" , "逃げさせる" , Language . Japanese ) ,
348
+ new Conjugation ( "Causative Positive Informal" , "逃げさせます" , Language . Japanese ) ,
349
+ new Conjugation ( "Causative Positive Informal" , "逃げさせない" , Language . Japanese ) ,
350
+ new Conjugation ( "Causative Positive Informal" , "逃げさせません" , Language . Japanese ) ,
351
+ } } ,
352
+ { "Imperative Positive Informal" , new [ ]
353
+ {
354
+ new Conjugation ( "Imperative Positive Informal" , "逃げよ/逃げろ" , Language . Japanese ) ,
355
+ new Conjugation ( "Imperative Positive Informal" , "逃げてください" , Language . Japanese ) ,
356
+ new Conjugation ( "Imperative Positive Informal" , "逃げるな" , Language . Japanese ) ,
357
+ new Conjugation ( "Imperative Positive Informal" , "逃げないでください" , Language . Japanese ) ,
358
+ } } ,
359
+ { "Conditional Positive Informal" , new [ ]
360
+ {
361
+ new Conjugation ( "Conditional Positive Informal" , "逃げれば" , Language . Japanese ) ,
362
+ new Conjugation ( "Conditional Positive Informal" , "逃げなければ" , Language . Japanese ) ,
363
+ } } ,
364
+ { "Conditional (-tara) Positive Informal" , new [ ]
365
+ {
366
+ new Conjugation ( "Conditional (-tara) Positive Informal" , "逃げたら" , Language . Japanese ) ,
367
+ new Conjugation ( "Conditional (-tara) Positive Informal" , "逃げなかったら" , Language . Japanese ) ,
368
+ } } ,
369
+ }
370
+ } ,
371
+ new MemoryStream ( Encoding . UTF8 . GetBytes ( Resource . Conjugation_Parse_Test_Japanese ) ) ,
372
+ } ;
373
+
374
+ yield return new object [ ]
375
+ {
376
+ new ConjugationData
377
+ {
378
+ Text = "לברוח" ,
379
+ Language = Language . Hebrew ,
380
+ Conjugations = new Dictionary < string , IEnumerable < Conjugation > >
381
+ {
382
+ { "Present" , new [ ]
383
+ {
384
+ new Conjugation ( "Present" , "בּוֹרַחַת" , Language . Hebrew ) ,
385
+ new Conjugation ( "Present" , "בּוֹרְחוֹת" , Language . Hebrew ) ,
386
+ new Conjugation ( "Present" , "בּוֹרֵחַ" , Language . Hebrew ) ,
387
+ new Conjugation ( "Present" , "בּוֹרְחִים" , Language . Hebrew ) ,
388
+ } } ,
389
+ { "Past" , new [ ]
390
+ {
391
+ new Conjugation ( "Past" , "בָּרַחְתִּי" , Language . Hebrew ) ,
392
+ new Conjugation ( "Past" , "בָּרַחְתְּ" , Language . Hebrew ) ,
393
+ new Conjugation ( "Past" , "בָּרְחָה" , Language . Hebrew ) ,
394
+ new Conjugation ( "Past" , "בָּרַחְתָּ" , Language . Hebrew ) ,
395
+ new Conjugation ( "Past" , "בָּרַח" , Language . Hebrew ) ,
396
+ new Conjugation ( "Past" , "בָּרַחְנוּ" , Language . Hebrew ) ,
397
+ new Conjugation ( "Past" , "בְּרַחְתֶּן" , Language . Hebrew ) ,
398
+ new Conjugation ( "Past" , "בָּרְחוּ" , Language . Hebrew ) ,
399
+ new Conjugation ( "Past" , "בְּרַחְתֶּם" , Language . Hebrew ) ,
400
+ } } ,
401
+ { "Future" , new [ ]
402
+ {
403
+ new Conjugation ( "Future" , "אֶבְרַח" , Language . Hebrew ) ,
404
+ new Conjugation ( "Future" , "תִּבְרְחִי" , Language . Hebrew ) ,
405
+ new Conjugation ( "Future" , "תִּבְרַח" , Language . Hebrew ) ,
406
+ new Conjugation ( "Future" , "יִבְרַח" , Language . Hebrew ) ,
407
+ new Conjugation ( "Future" , "נִבְרַח" , Language . Hebrew ) ,
408
+ new Conjugation ( "Future" , "תִּבְרְחוּ" , Language . Hebrew ) ,
409
+ new Conjugation ( "Future" , "יִבְרְחוּ" , Language . Hebrew ) ,
410
+ } } ,
411
+ { "Imperative" , new [ ]
412
+ {
413
+ new Conjugation ( "Imperative" , "בִּרְחִי" , Language . Hebrew ) ,
414
+ new Conjugation ( "Imperative" , "בִּרְחוּ" , Language . Hebrew ) ,
415
+ new Conjugation ( "Imperative" , "בְּרַח" , Language . Hebrew ) ,
416
+ } } ,
417
+ { "Passive Participle" , new [ ]
418
+ {
419
+ new Conjugation ( "Passive Participle" , "בְּרוּחָה" , Language . Hebrew ) ,
420
+ new Conjugation ( "Passive Participle" , "בְּרוּחוֹת" , Language . Hebrew ) ,
421
+ new Conjugation ( "Passive Participle" , "בָּרוּחַ" , Language . Hebrew ) ,
422
+ new Conjugation ( "Passive Participle" , "בְּרוּחִים" , Language . Hebrew ) ,
423
+ } } ,
424
+ { "Infinitive" , new [ ]
425
+ {
426
+ new Conjugation ( "Infinitive" , "לִבְרוֹחַ" , Language . Hebrew ) ,
427
+ } }
428
+ }
429
+ } ,
430
+ new MemoryStream ( Encoding . UTF8 . GetBytes ( Resource . Conjugation_Parse_Test_Hebrew ) ) ,
431
+ } ;
302
432
}
303
433
304
434
#endregion
0 commit comments