33using System . IO ;
44using System . Text ;
55using System . Collections . Generic ;
6- using ReversoAPI . Web . ConjugationFeature . Domain . Core . Entities ;
7- using ReversoAPI . Web . ConjugationFeature . Domain . Core . Interfaces . ValueObjects ;
86using ReversoAPI . Web . ConjugationFeature . Domain . Core . Services ;
9- using ReversoAPI . Web . ConjugationFeature . Domain . Core . ValueObjects ;
10- using ReversoAPI . Web . Shared . Domain . ValueObjects ;
117
128namespace ReversoAPI . Web . Tests . Parsers
139{
@@ -18,7 +14,7 @@ public class ConjugationResponseParserTest
1814 public void Invoke_Test ( ConjugationData expectedResult , Stream html )
1915 {
2016 // Arrange
21- var parser = new ConjugationParser ( ) ;
17+ var parser = new ConjugationParserService ( ) ;
2218
2319 // Act
2420 var result = parser . Invoke ( html ) ;
@@ -38,9 +34,9 @@ public static IEnumerable<object[]> HtmlResponsesForTest()
3834 {
3935 Text = "run" ,
4036 Language = Language . English ,
41- Conjugations = new Dictionary < string , IEnumerable < IConjugation > >
37+ Conjugations = new Dictionary < string , IEnumerable < Conjugation > >
4238 {
43- { "Indicative Present" , new [ ]
39+ { "Indicative Present" , new [ ]
4440 {
4541 new Conjugation ( "Indicative Present" , "run" , Language . English ) ,
4642 new Conjugation ( "Indicative Present" , "runs" , Language . English ) ,
@@ -78,7 +74,7 @@ public static IEnumerable<object[]> HtmlResponsesForTest()
7874 {
7975 Text = "бежать" ,
8076 Language = Language . Russian ,
81- Conjugations = new Dictionary < string , IEnumerable < IConjugation > >
77+ Conjugations = new Dictionary < string , IEnumerable < Conjugation > >
8278 {
8379 { "настоящее" , new [ ]
8480 {
@@ -138,12 +134,12 @@ public static IEnumerable<object[]> HtmlResponsesForTest()
138134 } ;
139135
140136 yield return new object [ ]
141- {
137+ {
142138 new ConjugationData
143139 {
144140 Text = "cair" ,
145141 Language = Language . Portuguese ,
146- Conjugations = new Dictionary < string , IEnumerable < IConjugation > >
142+ Conjugations = new Dictionary < string , IEnumerable < Conjugation > >
147143 {
148144 { "Indicativo Presente" , new [ ]
149145 {
@@ -298,7 +294,141 @@ public static IEnumerable<object[]> HtmlResponsesForTest()
298294 }
299295 } ,
300296 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+ } ;
302432 }
303433
304434 #endregion
0 commit comments