Exemplo n.º 1
0
 public void SfvData()
 {
     Race race = new Race (ArgsSfv);
     race.ParseUpload ();
     DataParserSfv sfvParser = new DataParserSfv (race);
     sfvParser.Parse ();
     sfvParser.Process ();
     Assert.AreEqual (4, race.TotalFilesExpected, "TotalFilesExpected");
     Dictionary<string, string> sfvData = sfvParser.SfvData;
     Assert.IsNotNull (sfvData, "sfvData");
     Dictionary<string, string> expectedSfvData = new Dictionary<string, string>
         {
             {"infected.part1.rar", "2e04944c"},
             {"infected.part2.rar", "1c7c24a5"},
             {"infected.part3.rar", "d5d617e3"},
             {"infected.part4.rar", "0edb20ea"}
         };
     Assert.AreEqual (expectedSfvData, sfvData);
 }
Exemplo n.º 2
0
 /// <summary>
 /// Starts with the file check.
 /// </summary>
 public void Process()
 {
     if (SkipCheck())
     {
         return;
     }
     RefuseFileExtension();
     if (!IsValid)
     {
         Log.Debug("Not Valid!");
         return;
     }
     IDataParser dataParser;
     if (CurrentRaceData.RaceType == RaceType.Nfo)
     {
         dataParser = new DataParserNfo(this);
         dataParser.Parse();
         dataParser.Process();
         return;
     }
     if (CurrentRaceData.RaceType == RaceType.Zip)
     {
         dataParser = new DataParserZip(this);
         dataParser.Parse();
         dataParser.Process();
         return;
     }
     if (CurrentRaceData.RaceType == RaceType.Diz)
     {
         IsValid = false;
         Log.Debug("DIZ not allowed!");
         return;
     }
     if (CurrentRaceData.RaceType == RaceType.Sfv)
     {
         dataParser = new DataParserSfv(this);
         dataParser.Parse();
         dataParser.Process();
         return;
     }
     if (!SfvCheck())
     {
         return;
     }
     dataParser = new DataParser(this);
     dataParser.Parse();
     dataParser.Process();
 }