예제 #1
0
 public void Constructor_KeyWordsFieldSurroundedByQuotes_QuotesIgnored()
 {
     using (var stream = new MemoryStream(Encoding.UTF8.GetBytes("filename\ten")))
         using (var reader = new StreamReader(stream))
         {
             var layout   = new ImageIndexReader(reader);
             var rowparts = "filename	\"boy,child\"".Split('\t');
             Assert.AreEqual("boy,child", layout.GetCSVOfKeywordsOrEmpty("en", rowparts), "Should strip off quotation marks");
         }
 }
예제 #2
0
 public void Constructor_AOR3dot2_ReadCorrectly()
 {
     using (var stream = new MemoryStream(Encoding.UTF8.GetBytes("order\tfilename\tartist\tcountry\ten\tru\tid\tfr\tes\tar\thi\tbn\tpt\tth\tsw\tzh")))
         using (var reader = new StreamReader(stream))
         {
             var layout = new ImageIndexReader(reader);
             Assert.AreEqual(12, layout.LanguageIds.Count);
             Assert.AreEqual("ru", layout.LanguageIds[1]);
             var row      = "1	B-3-3	TheArtist	Brazil	boy,child,head,people,shoulder	мальчик,ребёнок,голова,люди,плечо	anak laki-laki,anak,kepala,orang,orang-orang,bahu";
             var rowparts = row.Split('\t');
             Assert.AreEqual("B-3-3", layout.GetFilename(rowparts));
             Assert.AreEqual("Brazil", layout.GetSubFolderOrEmpty(rowparts));
             Assert.AreEqual("мальчик,ребёнок,голова,люди,плечо", layout.GetCSVOfKeywordsOrEmpty("ru", rowparts));
         }
 }