public void ParseTest() { object target = Media.DAC.Tests.Media_BC_MediaFileNameParserAccessor.CreatePrivate(); Media.DAC.Tests.Media_BC_MediaFileNameParserAccessor accessor = new Media.DAC.Tests.Media_BC_MediaFileNameParserAccessor(target); string [] fileNames = new string[] { @"M:\ALL_NEW_STUFF\Movies\Alexander.DVDRip.XviD-DMT\CD1\dmt-alexander-cd1.avi", @"M:\ALL_NEW_STUFF\Movies\Deuce Bigalow-European Gigolo DVDRip XviD-ALLiANCE 2005\alliance-deuce2-xvid.avi", @"M:\ALL_NEW_STUFF\Movies\Batman.Begins.DVDRip.XviD-DoNE\CD1\Batman.Begins.DVDRip.XviD-DoNE.1.avi", @"M:\ALL_NEW_STUFF\prison.break.s01e15.hr.hdtv.ac3.5.1.xvid-ctu.avi", @"M:\ALL_NEW_STUFF\smallville.517.hdtv-lol.avi", @"K:\TV Shows\Unsorted\er.1202.hdtv-lol.avi", @"M:\ALL_NEW_STUFF\24.515.hdtv-lol.avi", @"K:\TV Shows\X-Men Evolution\Season 4\X-Men Evolution 4x04 - Sins Of The Son.avi", @"K:\Tv Shows\Unsorted\Alias_-_4x22_-_Before_The_Flood.HR-HDTV.CTU.xvid.avi", @"K:\tv shows\Friends\season 10\friends.1006.the.one.with.ross's.grant.pdtv.avi" }; /* * MediaFileInfo expected = null; * MediaFileInfo actual; * * * Assert.AreEqual(expected, actual, "Media.BC.MediaFileNameParser.Parse did not return the expected value."); * Assert.Inconclusive("Verify the correctness of this test method.");*/ foreach (string fileName in fileNames) { Console.WriteLine("Testing: " + fileName); MediaFile actual = accessor.Parse(fileName); } }
public void TestAllShows() { object target = Media.DAC.Tests.Media_BC_MediaFileNameParserAccessor.CreatePrivate(); Media.DAC.Tests.Media_BC_MediaFileNameParserAccessor accessor = new Media.DAC.Tests.Media_BC_MediaFileNameParserAccessor(target); DirectoryInfo dirinfo = new DirectoryInfo(@"K:\tv shows"); int attempts = 0; int successes = 0; foreach (FileInfo fileInfo in dirinfo.GetFiles("*.avi", SearchOption.AllDirectories)) { if (fileInfo.FullName.Contains("Documentaries")) { continue; } attempts++; Console.WriteLine("Testing: " + fileInfo.FullName); MediaFile actual = accessor.Parse(fileInfo.FullName); if (actual.FileType == MediaFileType.TvEpisode) { successes++; } } Console.WriteLine("Attempts: " + attempts + ". Successes: " + successes + ". Failures: " + (attempts - successes) + ". Accuracy: " + ((double)successes / (double)attempts) * 100.0d); }
public void ParseTest() { object target = Media.DAC.Tests.Media_BC_MediaFileNameParserAccessor.CreatePrivate(); Media.DAC.Tests.Media_BC_MediaFileNameParserAccessor accessor = new Media.DAC.Tests.Media_BC_MediaFileNameParserAccessor(target); string []fileNames = new string[] { @"M:\ALL_NEW_STUFF\Movies\Alexander.DVDRip.XviD-DMT\CD1\dmt-alexander-cd1.avi", @"M:\ALL_NEW_STUFF\Movies\Deuce Bigalow-European Gigolo DVDRip XviD-ALLiANCE 2005\alliance-deuce2-xvid.avi", @"M:\ALL_NEW_STUFF\Movies\Batman.Begins.DVDRip.XviD-DoNE\CD1\Batman.Begins.DVDRip.XviD-DoNE.1.avi", @"M:\ALL_NEW_STUFF\prison.break.s01e15.hr.hdtv.ac3.5.1.xvid-ctu.avi", @"M:\ALL_NEW_STUFF\smallville.517.hdtv-lol.avi", @"K:\TV Shows\Unsorted\er.1202.hdtv-lol.avi", @"M:\ALL_NEW_STUFF\24.515.hdtv-lol.avi", @"K:\TV Shows\X-Men Evolution\Season 4\X-Men Evolution 4x04 - Sins Of The Son.avi", @"K:\Tv Shows\Unsorted\Alias_-_4x22_-_Before_The_Flood.HR-HDTV.CTU.xvid.avi", @"K:\tv shows\Friends\season 10\friends.1006.the.one.with.ross's.grant.pdtv.avi" }; /* MediaFileInfo expected = null; MediaFileInfo actual; Assert.AreEqual(expected, actual, "Media.BC.MediaFileNameParser.Parse did not return the expected value."); Assert.Inconclusive("Verify the correctness of this test method.");*/ foreach (string fileName in fileNames) { Console.WriteLine("Testing: " + fileName); MediaFile actual = accessor.Parse(fileName); } }
public void TestAllShows() { object target = Media.DAC.Tests.Media_BC_MediaFileNameParserAccessor.CreatePrivate(); Media.DAC.Tests.Media_BC_MediaFileNameParserAccessor accessor = new Media.DAC.Tests.Media_BC_MediaFileNameParserAccessor(target); DirectoryInfo dirinfo = new DirectoryInfo(@"K:\tv shows"); int attempts = 0; int successes = 0; foreach (FileInfo fileInfo in dirinfo.GetFiles("*.avi", SearchOption.AllDirectories)) { if (fileInfo.FullName.Contains("Documentaries")) continue; attempts++; Console.WriteLine("Testing: " + fileInfo.FullName); MediaFile actual = accessor.Parse(fileInfo.FullName); if (actual.FileType == MediaFileType.TvEpisode) successes++; } Console.WriteLine("Attempts: " + attempts + ". Successes: " + successes + ". Failures: " + (attempts - successes) + ". Accuracy: " + ((double)successes / (double)attempts) * 100.0d); }