public void ParseRaceData() { Race race = new Race(ArgsRarPart1); race.ParseUpload (); race.RaceFile = @"..\..\TestFiles\Race\.ioFTPD.race"; DataParser dataParser = new DataParser (race); dataParser.Parse (); Assert.AreEqual (4, race.TotalFilesExpected, "TotalFilesExpected"); Assert.AreEqual (4, race.TotalFilesUploaded, "TotalFilesUploaded"); }
/// <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(); }