Esempio n. 1
0
 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);
 }
Esempio n. 2
0
 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);
 }
Esempio n. 3
0
 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);
 }
Esempio n. 4
0
        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);
                  }
               }
            }
             }
        }
Esempio n. 5
0
 private string CreateDestinationDirectory(Show Show)
 {
     string destinationDirectory = Path.Combine(destination, Show.Name);
      if (!Directory.Exists(destinationDirectory))
      {
     Directory.CreateDirectory(destinationDirectory);
      }
      return destinationDirectory;
 }
Esempio n. 6
0
        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));
        }
Esempio n. 7
0
 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);
 }
Esempio n. 8
0
 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);
 }
Esempio n. 9
0
 public void ShouldSucceedWhenResolution720IsDetermined()
 {
     const string FileName = "Dark.Blue.S01E04.720p.HDTV.X264-DIMENSION.mkv";
      Show Show = new Show(FileName);
      Assert.AreEqual("720p", Show.Resolution);
 }
Esempio n. 10
0
 public void ShouldSucceedWhenResolution1080IsDetermined()
 {
     const string FileName = "Warehouse.13.S01E11.1080p.HDTV.x264-CTU.mkv";
      Show Show = new Show(FileName);
      Assert.AreEqual("1080p", Show.Resolution);
 }
Esempio n. 11
0
 public void ShouldSucceedWhenFileNameIsValidShow2()
 {
     const string FileName = "psych.s04e02.720p.hdtv.x264-ctu.mkv";
      Show Show = new Show(FileName);
      Assert.AreEqual(true, Show.IsValid);
 }
Esempio n. 12
0
 public void ShouldSucceedWhenFileNameIsValidShow()
 {
     const string FileName = "Dark.Blue.S01E04.1080P.HDTV.X264-DIMENSION.mkv";
      Show Show = new Show(FileName);
      Assert.AreEqual(true, Show.IsValid);
 }
Esempio n. 13
0
 public void ShouldSucceedWhenFileNameIsNotValidShow()
 {
     const string FileName = "Dark.Blue.mkv";
      Show Show = new Show(FileName);
      Assert.AreEqual(false, Show.IsValid);
 }
Esempio n. 14
0
 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);
 }
Esempio n. 15
0
 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);
 }