Пример #1
0
 public void CreateLink()
 {
     Race race = new Race(ArgsRarPart1);
     race.ParseUpload();
     TagManager tagManager = new TagManager(race);
     const string testlink = "[iNCOMPLETE]-testLink";
     tagManager.CreateSymLink(".", testlink);
     Assert.IsTrue(Directory.Exists(testlink));
     Directory.Delete(testlink);
 }
Пример #2
0
 public void RefuseExtension()
 {
     CleanTestFilesOutput();
     Race race = new Race(ArgsBat);
     race.ParseUpload();
     Assert.AreEqual(".bat", race.CurrentRaceData.FileExtension, "FileExtension");
     Assert.AreEqual("file_bat.bat", race.CurrentRaceData.FileName, "FileName");
     Assert.AreEqual("Zip", race.CurrentRaceData.DirectoryName, "DirectoryName");
     race.Process();
     Assert.IsFalse(race.IsValid);
 }
Пример #3
0
 public void Format()
 {
     Race race = new Race(new[] {"upload", @"..\..\TestFiles\Mp3\06-judas_priest-beyond_the_realms_of_death.mp3", "00000000", @"../../TestFiles/Mp3/06-judas_priest-beyond_the_realms_of_death.mp3"});
     race.ParseUpload();
     const int totalFilesExpected = 123;
     race.TotalFilesExpected = totalFilesExpected;
     bool isAudioRace = race.IsAudioRace;
     Assert.IsTrue(isAudioRace);
     Output output = new Output(race);
     File file = File.Create(@"..\..\TestFiles\Mp3\06-judas_priest-beyond_the_realms_of_death.mp3");
     Assert.AreEqual("06-judas_priest-beyond_the_realms_of_death.mp3", output.Format("{0}", file), "FileName");
     Assert.AreEqual("Mp3", output.Format("{1}", file), "DirectoryName");
     Assert.AreEqual("NoUser", output.Format("{2}", file), "UserName");
     Assert.AreEqual("NoGroup", output.Format("{3}", file), "GroupName");
     Assert.AreEqual("/NoPath", output.Format("{4}", file), "UploadVirtualPath");
     Assert.AreEqual(totalFilesExpected.ToString(), output.Format("{5}", file), "TotalFilesExpected");
     Assert.AreEqual("0", output.Format("{6}", file), "TotalFilesUploaded");
     Assert.AreEqual("0", output.Format("{7}", file), "TotalBytesUploaded");
     Assert.AreEqual("0", output.Format("{8}", file), "TotalMegaBytesUploaded");
     Assert.AreEqual("0B", output.Format("{9}", file), "TotalBytesUploadedFormated");
     Assert.AreEqual("0B", output.Format("{10}", file), "TotalBytesExpected");
     Assert.AreEqual("1", output.Format("{11}", file), "TotalAvarageSpeed");
     Assert.AreEqual("0", output.Format("{12}", file), "TotalUsersRacing");
     Assert.AreEqual("0", output.Format("{13}", file), "TotalGroupsRacing");
     Assert.AreEqual("-----------------", output.Format("{14}", file), "ProgressBar");
     Assert.AreEqual("0%", output.Format("{15}%", file), "PercentComplete");
     Assert.AreEqual(Constants.CodeIrcColor, output.Format("{16}", file), "CodeIrcColor");
     Assert.AreEqual(Constants.CodeIrcBold, output.Format("{17}", file), "CodeIrcBold");
     Assert.AreEqual(Constants.CodeIrcUnderline, output.Format("{18}", file), "CodeIrcUnderline");
     Assert.AreEqual(Constants.CodeNewLine, output.Format("{19}", file), "codeNewLine");
     Assert.AreEqual("Judas Priest", output.Format("{20}", file), "FirstPerformer");
     Assert.AreEqual("A Touch of Evil Live", output.Format("{21}", file), "Album");
     Assert.AreEqual("Beyond the Realms of Death", output.Format("{22}", file), "Title");
     Assert.AreEqual("Heavy Metal", output.Format("{23}", file), "FirstGenre");
     Assert.AreEqual("2009", output.Format("{24}", file), "Year");
     Assert.AreEqual("6", output.Format("{25}", file), "Track");
     Assert.AreEqual("1", output.Format("{26}", file), "Speed");
     Assert.AreEqual("231", output.Format("{27}", file), "AudioBitrate");
     Assert.AreEqual("2", output.Format("{28}", file), "AudioChannels");
     Assert.AreEqual("44100", output.Format("{29}", file), "AudioSampleRate");
     Assert.AreEqual("0", output.Format("{30}", file), "BitsPerSample");
     Assert.AreEqual("MPEG Version 1 Audio, Layer 3 VBR", output.Format("{31}", file), "Description");
     Assert.AreEqual("Audio", output.Format("{32}", file), "MediaTypes");
     Assert.AreEqual("MPEG Version 1 Audio, Layer 3 VBR", output.Format("{33}", file), "Codecs");
     Assert.AreEqual("00:06:51", output.Format("{34}", file), "Duration");
 }
Пример #4
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);
 }
Пример #5
0
 public void CurrentUploadData()
 {
     Race race = new Race(ArgsRarPart1);
     race.ParseUpload();
     Assert.AreEqual("Rar", race.CurrentRaceData.DirectoryName, "DirectoryName");
     Assert.That(race.CurrentRaceData.DirectoryPath.EndsWith(@"\TestFiles\Rar"), "DirectoryPath");
     Assert.That(race.CurrentRaceData.DirectoryParent.EndsWith(@"\TestFiles"), "DirectoryParent");
     Assert.AreEqual(".rar", race.CurrentRaceData.FileExtension, "FileExtension");
     Assert.AreEqual("infected.part1.rar", race.CurrentRaceData.FileName, "FileName");
     Assert.AreEqual(5000, race.CurrentRaceData.FileSize, "FileSize");
     Assert.AreEqual("NoGroup", race.CurrentRaceData.GroupName, "GroupName");
     Assert.AreEqual(1, race.CurrentRaceData.Speed, "Speed");
     Assert.AreEqual("2e04944c", race.CurrentRaceData.UploadCrc, "UploadCrc");
     Assert.AreEqual(@"..\..\TestFiles\Rar\infected.part1.rar", race.CurrentRaceData.UploadFile, "UploadFile");
     Assert.AreEqual("/TestFiles/Rar/infected.part1.rar", race.CurrentRaceData.UploadVirtualFile, "UploadVirtualFile");
     Assert.AreEqual("NoUser", race.CurrentRaceData.UserName, "UserName");
     Assert.AreEqual(0, race.CurrentRaceData.Uid, "UID");
     Assert.AreEqual(0, race.CurrentRaceData.Gid, "GID");
     Assert.AreEqual("/NoPath", race.CurrentRaceData.UploadVirtualPath, "UploadVirtualPath");
 }
Пример #6
0
 public void SpeedTest()
 {
     Race race = new Race(ArgsRarPart1);
     race.ParseUpload();
     race.CurrentRaceData.UploadVirtualPath = Config.SpeedTestFolder + "asdfsdfsdf";
     Assert.IsTrue(race.SpeedTest(), "race.SpeedTest");
 }
Пример #7
0
 public void SkipPath()
 {
     Race race = new Race(ArgsRarPart1);
     race.ParseUpload();
     Assert.IsFalse(race.VirtualPathMatch(Config.SkipPath), "race.SkipPath");
 }
Пример #8
0
 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");
 }
Пример #9
0
        public void ZipRace()
        {
            CleanTestFilesOutput();

            Race race = new Race(ArgsCorrectZipFile1);
            race.ParseUpload();
            race.Process();
            Assert.IsTrue(race.IsValid);
            FileInfo fileInfo = new FileInfo(Misc.PathCombine(race.CurrentRaceData.DirectoryPath, Config.FileNameRace));
            const int fileSize = 24683;
            using (FileStream stream = new FileStream(fileInfo.FullName,
                                                       FileMode.Open,
                                                       FileAccess.Read,
                                                       FileShare.None))
            {
                using (BinaryReader reader = new BinaryReader(stream))
                {
                    stream.Seek(0, SeekOrigin.Begin);
                    Assert.AreEqual(5, reader.ReadInt32(), "Total files count");
                    stream.Seek(256 * 5, SeekOrigin.Begin);
                    Assert.AreEqual("file-000.zip", reader.ReadString(), "FileName");
                    Assert.AreEqual("00000000", reader.ReadString(), "CRC32");
                    Assert.AreEqual(true, reader.ReadBoolean(), "File was uploaded");
                    Assert.AreEqual((UInt64)fileSize, reader.ReadUInt64(), "FileSize");
                }
            }
            Assert.AreEqual((UInt64)fileSize, race.TotalBytesUploaded, "TotalBytesUploaded");
            Assert.AreEqual(5, race.TotalFilesExpected, "TotalFilesExpected");
            Assert.AreEqual(1, race.TotalFilesUploaded, "TotalFilesUploaded");

            race = new Race(ArgsCorrectZipFile2);
            race.ParseUpload();
            race.Process();
            fileInfo = new FileInfo(Misc.PathCombine(race.CurrentRaceData.DirectoryPath, Config.FileNameRace));
            using (FileStream stream = new FileStream(fileInfo.FullName,
                                                       FileMode.Open,
                                                       FileAccess.Read,
                                                       FileShare.None))
            {
                using (BinaryReader reader = new BinaryReader(stream))
                {
                    stream.Seek(0, SeekOrigin.Begin);
                    Assert.AreEqual(5, reader.ReadInt32(), "Total files count");
                    stream.Seek(256 * 4, SeekOrigin.Begin);
                    Assert.AreEqual("file-001.zip", reader.ReadString(), "FileName");
                    Assert.AreEqual("00000000", reader.ReadString(), "CRC32");
                    Assert.AreEqual(true, reader.ReadBoolean(), "File was uploaded");
                    Assert.AreEqual((UInt64)fileSize, reader.ReadUInt64(), "FileSize");
                }
            }
            Assert.AreEqual((UInt64)fileSize * 2, race.TotalBytesUploaded, "TotalBytesUploaded");
            Assert.AreEqual(5, race.TotalFilesExpected, "TotalFilesExpected");
            Assert.AreEqual(2, race.TotalFilesUploaded, "TotalFilesUploaded");

            race = new Race(ArgsCorrectZipFile3);
            race.ParseUpload();
            race.Process();
            fileInfo = new FileInfo(Misc.PathCombine(race.CurrentRaceData.DirectoryPath, Config.FileNameRace));
            using (FileStream stream = new FileStream(fileInfo.FullName,
                                                       FileMode.Open,
                                                       FileAccess.Read,
                                                       FileShare.None))
            {
                using (BinaryReader reader = new BinaryReader(stream))
                {
                    stream.Seek(0, SeekOrigin.Begin);
                    Assert.AreEqual(5, reader.ReadInt32(), "Total files count");
                    stream.Seek(256 * 3, SeekOrigin.Begin);
                    Assert.AreEqual("file-002.zip", reader.ReadString(), "FileName");
                    Assert.AreEqual("00000000", reader.ReadString(), "CRC32");
                    Assert.AreEqual(true, reader.ReadBoolean(), "File was uploaded");
                    Assert.AreEqual((UInt64)fileSize, reader.ReadUInt64(), "FileSize");
                }
            }
            Assert.AreEqual((UInt64)fileSize * 3, race.TotalBytesUploaded, "TotalBytesUploaded");
            Assert.AreEqual(5, race.TotalFilesExpected, "TotalFilesExpected");
            Assert.AreEqual(3, race.TotalFilesUploaded, "TotalFilesUploaded");

            race = new Race(ArgsCorrectZipFile4);
            race.ParseUpload();
            race.Process();
            fileInfo = new FileInfo(Misc.PathCombine(race.CurrentRaceData.DirectoryPath, Config.FileNameRace));
            using (FileStream stream = new FileStream(fileInfo.FullName,
                                                       FileMode.Open,
                                                       FileAccess.Read,
                                                       FileShare.None))
            {
                using (BinaryReader reader = new BinaryReader(stream))
                {
                    stream.Seek(0, SeekOrigin.Begin);
                    Assert.AreEqual(5, reader.ReadInt32(), "Total files count");
                    stream.Seek(256 * 2, SeekOrigin.Begin);
                    Assert.AreEqual("file-003.zip", reader.ReadString(), "FileName");
                    Assert.AreEqual("00000000", reader.ReadString(), "CRC32");
                    Assert.AreEqual(true, reader.ReadBoolean(), "File was uploaded");
                    Assert.AreEqual((UInt64)fileSize, reader.ReadUInt64(), "FileSize");
                }
            }
            Assert.AreEqual((UInt64)fileSize * 4, race.TotalBytesUploaded, "TotalBytesUploaded");
            Assert.AreEqual(5, race.TotalFilesExpected, "TotalFilesExpected");
            Assert.AreEqual(4, race.TotalFilesUploaded, "TotalFilesUploaded");

            race = new Race(ArgsCorrectZipFile5);
            race.ParseUpload();
            race.Process();
            fileInfo = new FileInfo(Misc.PathCombine(race.CurrentRaceData.DirectoryPath, Config.FileNameRace));
            using (FileStream stream = new FileStream(fileInfo.FullName,
                                                       FileMode.Open,
                                                       FileAccess.Read,
                                                       FileShare.None))
            {
                using (BinaryReader reader = new BinaryReader(stream))
                {
                    stream.Seek(0, SeekOrigin.Begin);
                    Assert.AreEqual(5, reader.ReadInt32(), "Total files count");
                    stream.Seek(256 * 1, SeekOrigin.Begin);
                    Assert.AreEqual("file-004.zip", reader.ReadString(), "FileName");
                    Assert.AreEqual("00000000", reader.ReadString(), "CRC32");
                    Assert.AreEqual(true, reader.ReadBoolean(), "File was uploaded");
                    Assert.AreEqual((UInt64)fileSize, reader.ReadUInt64(), "FileSize");
                }
            }
            Assert.AreEqual((UInt64)fileSize * 5, race.TotalBytesUploaded, "TotalBytesUploaded");
            Assert.AreEqual(5, race.TotalFilesExpected, "TotalFilesExpected");
            Assert.AreEqual(5, race.TotalFilesUploaded, "TotalFilesUploaded");
        }
Пример #10
0
        public void ZipRaceNoDiz()
        {
            CleanTestFilesOutput();

            Race race = new Race(ArgsZipFile1);
            race.ParseUpload();
            race.Process();
            Assert.IsFalse(race.IsValid);
        }
Пример #11
0
        public void RaceRar()
        {
            CleanTestFilesOutput ();
            UploadSfvFile ();

            Race race = new Race (ArgsRarPart1);
            race.ParseUpload ();
            race.Process ();
            FileInfo fileInfo = new FileInfo(Misc.PathCombine(race.CurrentRaceData.DirectoryPath, Config.FileNameRace));
            using (FileStream stream = new FileStream (fileInfo.FullName,
                                                       FileMode.Open,
                                                       FileAccess.Read,
                                                       FileShare.None))
            {
                using (BinaryReader reader = new BinaryReader (stream))
                {
                    stream.Seek (0, SeekOrigin.Begin);
                    Assert.AreEqual (4, reader.ReadInt32 (), "Total files count");
                    stream.Seek (256 * 1, SeekOrigin.Begin);
                    Assert.AreEqual ("infected.part1.rar", reader.ReadString (), "FileName");
                    Assert.AreEqual ("2e04944c", reader.ReadString (), "CRC32");
                    Assert.AreEqual (true, reader.ReadBoolean (), "File was uploaded");
                    Assert.AreEqual ((UInt64) 5000, reader.ReadUInt64 (), "FileSize");
                }
            }
            Assert.AreEqual((UInt64)5000, race.TotalBytesUploaded, "TotalBytesUploaded");
            Assert.AreEqual(4, race.TotalFilesExpected, "TotalFilesExpected");
            Assert.AreEqual(1, race.TotalFilesUploaded, "TotalFilesUploaded");

            race = new Race(ArgsRarPart2);
            race.ParseUpload();
            race.Process();
            fileInfo = new FileInfo(Misc.PathCombine(race.CurrentRaceData.DirectoryPath, Config.FileNameRace));
            using (FileStream stream = new FileStream(fileInfo.FullName,
                                                      FileMode.Open,
                                                      FileAccess.Read,
                                                      FileShare.None))
            {
                using (BinaryReader reader = new BinaryReader(stream))
                {
                    stream.Seek(0, SeekOrigin.Begin);
                    Assert.AreEqual(4, reader.ReadInt32(), "Total files count");
                    stream.Seek(256 * 2, SeekOrigin.Begin);
                    Assert.AreEqual("infected.part2.rar", reader.ReadString(), "FileName");
                    Assert.AreEqual("1c7c24a5", reader.ReadString(), "CRC32");
                    Assert.AreEqual(true, reader.ReadBoolean(), "File was uploaded");
                    Assert.AreEqual((UInt64)5000, reader.ReadUInt64(), "FileSize");
                }
            }
            Assert.AreEqual((UInt64)5000 * 2, race.TotalBytesUploaded, "TotalBytesUploaded");
            Assert.AreEqual(4, race.TotalFilesExpected, "TotalFilesExpected");
            Assert.AreEqual(2, race.TotalFilesUploaded, "TotalFilesUploaded");

            race = new Race(ArgsRarPart3);
            race.ParseUpload();
            race.Process();
            fileInfo = new FileInfo(Misc.PathCombine(race.CurrentRaceData.DirectoryPath, Config.FileNameRace));
            using (FileStream stream = new FileStream(fileInfo.FullName,
                                                      FileMode.Open,
                                                      FileAccess.Read,
                                                      FileShare.None))
            {
                using (BinaryReader reader = new BinaryReader(stream))
                {
                    stream.Seek(0, SeekOrigin.Begin);
                    Assert.AreEqual(4, reader.ReadInt32(), "Total files count");
                    stream.Seek(256 * 3, SeekOrigin.Begin);
                    Assert.AreEqual("infected.part3.rar", reader.ReadString(), "FileName");
                    Assert.AreEqual("d5d617e3", reader.ReadString(), "CRC32");
                    Assert.AreEqual(true, reader.ReadBoolean(), "File was uploaded");
                    Assert.AreEqual((UInt64)5000, reader.ReadUInt64(), "FileSize");
                }
            }
            Assert.AreEqual((UInt64)5000 * 3, race.TotalBytesUploaded, "TotalBytesUploaded");
            Assert.AreEqual(4, race.TotalFilesExpected, "TotalFilesExpected");
            Assert.AreEqual(3, race.TotalFilesUploaded, "TotalFilesUploaded");

            race = new Race(ArgsRarPart4);
            race.ParseUpload();
            race.Process();
            fileInfo = new FileInfo(Misc.PathCombine(race.CurrentRaceData.DirectoryPath, Config.FileNameRace));
            using (FileStream stream = new FileStream(fileInfo.FullName,
                                                      FileMode.Open,
                                                      FileAccess.Read,
                                                      FileShare.None))
            {
                using (BinaryReader reader = new BinaryReader(stream))
                {
                    stream.Seek(0, SeekOrigin.Begin);
                    Assert.AreEqual(4, reader.ReadInt32(), "Total files count");
                    stream.Seek(256 * 4, SeekOrigin.Begin);
                    Assert.AreEqual("infected.part4.rar", reader.ReadString(), "FileName");
                    Assert.AreEqual("0edb20ea", reader.ReadString(), "CRC32");
                    Assert.AreEqual(true, reader.ReadBoolean(), "File was uploaded");
                    Assert.AreEqual((UInt64)2916, reader.ReadUInt64(), "FileSize");
                }
            }
            Assert.AreEqual((UInt64)5000 * 3 + 2916, race.TotalBytesUploaded, "TotalBytesUploaded");
            Assert.AreEqual(4, race.TotalFilesExpected, "TotalFilesExpected");
            Assert.AreEqual(4, race.TotalFilesUploaded, "TotalFilesUploaded");
        }
Пример #12
0
 public void Race()
 {
     CleanTestFilesOutput();
     UploadSfvFileMp3();
     Race race = new Race(ArgsMp3File1);
     race.ParseUpload();
     race.Process();
     Output output = new Output(race);
     FileInfo fileInfo = new FileInfo(Misc.PathCombine(race.CurrentRaceData.DirectoryPath, Config.FileNameRace));
     using (FileStream stream = new FileStream(fileInfo.FullName,
                                               FileMode.Open,
                                               FileAccess.Read,
                                               FileShare.None))
     {
         using (BinaryReader reader = new BinaryReader(stream))
         {
             stream.Seek(0, SeekOrigin.Begin);
             Assert.AreEqual(4, reader.ReadInt32(), "Total files count");
             stream.Seek(256 * 1, SeekOrigin.Begin);
             Assert.AreEqual("01-jozek.Pepek-2009-asd-Ind.mp3", reader.ReadString(), "FileName");
             Assert.AreEqual("2e04944c", reader.ReadString(), "CRC32");
             Assert.AreEqual(true, reader.ReadBoolean(), "File was uploaded");
             Assert.AreEqual((UInt64) 5000, reader.ReadUInt64(), "FileSize");
         }
     }
     Assert.AreEqual((UInt64) 5000, race.TotalBytesUploaded, "TotalBytesUploaded");
     Assert.AreEqual(4, race.TotalFilesExpected, "TotalFilesExpected");
     Assert.AreEqual(1, race.TotalFilesUploaded, "TotalFilesUploaded");
     Assert.IsFalse(
         File.Exists(@"..\..\TestFiles\Mp3\01-jozek.Pepek-2009-asd-Ind.mp3" + Config.FileExtensionMissing),
         "01-jozek.Pepek-2009-asd-Ind.mp3" + Config.FileExtensionMissing);
     Assert.IsTrue(
         Directory.Exists(Misc.PathCombine(race.CurrentRaceData.DirectoryParent, output.Format(Config.TagIncompleteLink))),
         "Symlink does not exist!");
     race = new Race(ArgsMp3File2);
     race.ParseUpload();
     race.Process();
     output = new Output(race);
     Assert.IsFalse(
         File.Exists(@"..\..\TestFiles\Mp3\02-jozek.Pepek-2009-asd-Ind.mp3" + Config.FileExtensionMissing),
         "02-jozek.Pepek-2009-asd-Ind.mp3" + Config.FileExtensionMissing);
     Assert.IsTrue(
         Directory.Exists(Misc.PathCombine(race.CurrentRaceData.DirectoryParent, output.Format(Config.TagIncompleteLink))),
         "Symlink does not exist!");
     race = new Race(ArgsMp3File3);
     race.ParseUpload();
     race.Process();
     output = new Output(race);
     Assert.IsFalse(
         File.Exists(@"..\..\TestFiles\Mp3\03-jozek.Pepek-2009-asd-Ind(2).mp3" + Config.FileExtensionMissing),
         "03-jozek.Pepek-2009-asd-Ind(2).mp3" + Config.FileExtensionMissing);
     Assert.IsTrue(
         Directory.Exists(Misc.PathCombine(race.CurrentRaceData.DirectoryParent, output.Format(Config.TagIncompleteLink))),
         "Symlink does not exist!");
     race = new Race(ArgsMp3File4);
     race.ParseUpload();
     race.Process();
     output = new Output(race);
     Assert.AreEqual(4, race.TotalFilesExpected, "TotalFilesExpected");
     Assert.AreEqual(4, race.TotalFilesUploaded, "TotalFilesUploaded");
     Assert.IsFalse(
         File.Exists(@"..\..\TestFiles\Mp3\04-jozek.Pepek-2009-asd-Ind(3).mp3" + Config.FileExtensionMissing),
         "04-jozek.Pepek-2009-asd-Ind(3).mp3" + Config.FileExtensionMissing);
     Assert.IsFalse(
         Directory.Exists(Misc.PathCombine(race.CurrentRaceData.DirectoryParent, output.Format(Config.TagIncompleteLink))),
         "Symlink not deleted!");
 }
Пример #13
0
 protected Race UploadSfvFileMp3()
 {
     Race race = new Race(ArgsSfvMp3);
     race.ParseUpload();
     Assert.AreEqual(".sfv", race.CurrentRaceData.FileExtension, "FileExtension");
     Assert.AreEqual("jozek.Pepek-2009-asd-Ind.sfv", race.CurrentRaceData.FileName, "FileName");
     //Assert.AreEqual(554, race.CurrentRaceData.FileSize, "FileSize");
     Assert.AreEqual("Mp3", race.CurrentRaceData.DirectoryName, "DirectoryName");
     race.Process();
     return race;
 }
Пример #14
0
 protected Race UploadSfvFile()
 {
     Race race = new Race(ArgsSfv);
     race.ParseUpload();
     Assert.AreEqual(".sfv", race.CurrentRaceData.FileExtension, "FileExtension");
     Assert.AreEqual("infected.sfv", race.CurrentRaceData.FileName, "FileName");
     Assert.AreEqual(432, race.CurrentRaceData.FileSize, "FileSize");
     Assert.AreEqual("Rar", race.CurrentRaceData.DirectoryName, "DirectoryName");
     race.Process();
     return race;
 }
Пример #15
0
 protected Race UploadNfoFile02()
 {
     Race race = new Race(ArgsNfo02);
     race.ParseUpload();
     Assert.AreEqual(".nfo", race.CurrentRaceData.FileExtension, "FileExtension");
     Assert.AreEqual("Movie02.nfo", race.CurrentRaceData.FileName, "FileName");
     Assert.AreEqual("Nfo", race.CurrentRaceData.DirectoryName, "DirectoryName");
     race.Process();
     return race;
 }
Пример #16
0
 protected Race UploadDizFile()
 {
     Race race = new Race(ArgsDiz);
     race.ParseUpload();
     Assert.AreEqual(".diz", race.CurrentRaceData.FileExtension, "FileExtension");
     Assert.AreEqual("file_id.diz", race.CurrentRaceData.FileName, "FileName");
     Assert.AreEqual(350, race.CurrentRaceData.FileSize, "FileSize");
     Assert.AreEqual("Zip", race.CurrentRaceData.DirectoryName, "DirectoryName");
     race.Process();
     return race;
 }