public void ShouldSucceedWhenCorrectSeasonAndEpisodeAreDetermined2() { const string FileName = "Warehouse.13.S01E11.720p.HDTV.x264-CTU.mkv"; Show Show = new Show(FileName); Assert.AreEqual(11, Show.Episode); Assert.AreEqual(1, Show.Season); }
public void ShouldParseLimitedSeasonAndEpisode() { const string FileName = "lie.to.me.218.720p-dimension.mkv"; Show Show = new Show(FileName); Assert.AreEqual(2, Show.Season); Assert.AreEqual(18, Show.Episode); }
public void ShouldSucceedWhenCorrectSeasonAndEpisodeAreDetermined1() { const string FileName = "Dark.Blue.S01E04.720p.HDTV.X264-DIMENSION.mkv"; Show Show = new Show(FileName); Assert.AreEqual(4, Show.Episode); Assert.AreEqual(1, Show.Season); }
public void Move(Show Show) { if (Show.IsValid) { string destinationDirectory = CreateDestinationDirectory(Show); string destinationFileName = Path.Combine(destinationDirectory, Show.FileName); if (File.Exists(destinationFileName)) File.Delete(destinationFileName); File.Move(Show.FullName, destinationFileName); string sourceDirectory = new FileInfo(Show.FullName).DirectoryName; if (sourceDirectory != null) { FileInfo[] subTitles = new DirectoryInfo(sourceDirectory).GetFiles("*.srt"); foreach (FileInfo subTitle in subTitles) { string destinationSubFileName = Path.Combine(destinationDirectory, subTitle.Name); if (!File.Exists(destinationSubFileName)) { File.Move(subTitle.FullName, destinationSubFileName); } } } } }
private string CreateDestinationDirectory(Show Show) { string destinationDirectory = Path.Combine(destination, Show.Name); if (!Directory.Exists(destinationDirectory)) { Directory.CreateDirectory(destinationDirectory); } return destinationDirectory; }
public void ShouldSucceedWhenShowIsMovedToTheCorrectLocation() { Show ShowToMove = new Show(sourceFileNameAndPath); ShowMover ShowsMover = new ShowMover(CreateOrganisationConfiguration()); ShowsMover.Move(ShowToMove); string destinationFilenameAndPath = Path.Combine(Path.Combine(destinationFolder, ShowName), SourceFilename); Assert.AreEqual(true, File.Exists(destinationFilenameAndPath)); }
public void ShouldSucceedWhenShowNameIsDetermined2() { const string FileName = "warehouse.13.S01E11.720p.HDTV.x264-CTU.mkv"; Show Show = new Show(FileName); Assert.AreEqual("Warehouse 13", Show.Name); }
public void ShouldSucceedWhenShowNameIsDetermined1() { const string FileName = "Dark.Blue.the.Cool.One.S01E04.720p.HDTV.X264-DIMENSION.mkv"; Show Show = new Show(FileName); Assert.AreEqual("Dark Blue The Cool One", Show.Name); }
public void ShouldSucceedWhenResolution720IsDetermined() { const string FileName = "Dark.Blue.S01E04.720p.HDTV.X264-DIMENSION.mkv"; Show Show = new Show(FileName); Assert.AreEqual("720p", Show.Resolution); }
public void ShouldSucceedWhenResolution1080IsDetermined() { const string FileName = "Warehouse.13.S01E11.1080p.HDTV.x264-CTU.mkv"; Show Show = new Show(FileName); Assert.AreEqual("1080p", Show.Resolution); }
public void ShouldSucceedWhenFileNameIsValidShow2() { const string FileName = "psych.s04e02.720p.hdtv.x264-ctu.mkv"; Show Show = new Show(FileName); Assert.AreEqual(true, Show.IsValid); }
public void ShouldSucceedWhenFileNameIsValidShow() { const string FileName = "Dark.Blue.S01E04.1080P.HDTV.X264-DIMENSION.mkv"; Show Show = new Show(FileName); Assert.AreEqual(true, Show.IsValid); }
public void ShouldSucceedWhenFileNameIsNotValidShow() { const string FileName = "Dark.Blue.mkv"; Show Show = new Show(FileName); Assert.AreEqual(false, Show.IsValid); }
public void ShouldUsePathInformationWhenSeasonAndEpisodeCannotBeDetermined() { const string FileName = @"/Fringe\ S02E05/fringe.205.dream.logic-sitv.mkv"; Show Show = new Show(FileName); Assert.AreEqual("Fringe", Show.Name); Assert.AreEqual(2, Show.Season); Assert.AreEqual(5, Show.Episode); }
public void ShouldIgnorePathDuringDetermination() { const string FileName = @"/folder1/test.d3/\ test\ number one/Dark.Blue.S01E04.720p.HDTV.X264-DIMENSION.mkv"; Show Show = new Show(FileName); Assert.AreEqual("Dark Blue", Show.Name); }