示例#1
0
 public ChangeTagsCommand(IMp3File mp3File, string mask)
 {
     File        = mp3File;
     _maskParser = new MaskParser(mask);
     OldTags     = new Mp3Tags();
     File.Tags.CopyTo(OldTags);
 }
示例#2
0
        public void CleanUp()
        {
            var parser = new MaskParser(_expectedMask);

            Assert.AreEqual(_expectedMask, parser.GetMaskFromTagsAndSplits());
            CollectionAssert.AreEqual(_expectedTags, parser.GetTags());
            CollectionAssert.AreEqual(_expectedSplits, parser.GetSplits());
        }
示例#3
0
 public AnalyseCommand(IMp3File mp3File, string mask, IWorker worker)
 {
     File        = mp3File;
     _worker     = worker;
     _maskParser = new MaskParser(mask);
 }
示例#4
0
 public void MaskParser_WithoutSplits_Exception()
 {
     var parser = new MaskParser("{artist}{track}");
     parser.ValidateFileName("TestArtist1");
 }
示例#5
0
 public void MaskParser_SplitInBeginAndEnd_Successful()
 {
     var parser = new MaskParser("-{artist}.{track}-");
     Assert.IsTrue(parser.ValidateFileName("-TestArtist.1-"));
 }
示例#6
0
 public void MaskParser_SplitInBegin_Successful()
 {
     var parser = new MaskParser("a{artist}");
     Assert.IsTrue(parser.ValidateFileName("aTestArtist"));
 }
示例#7
0
 public void MaskParser_SameSplits_Successful()
 {
     var parser = new MaskParser("{artist} - {title} - {track}");
     Assert.IsTrue(parser.ValidateFileName("TestArtist - TestTitle - 1"));
 }
示例#8
0
 public void MaskParser_ManySplits_Exception()
 {
     var parser = new MaskParser("{artist}-{track}");
     parser.ValidateFileName("Test-Artist-1");
 }
示例#9
0
 public void MaskParser_LetterInCenter_Successful()
 {
     var parser = new MaskParser("{artist}Q{track}");
     Assert.IsTrue(parser.ValidateFileName("TestArtistQ1"));
 }
示例#10
0
 public void MaskParser_Common_Successful()
 {
     var parser = new MaskParser("{artist} - {title}");
     Assert.IsTrue(parser.ValidateFileName("TestArtist - TestTitle"));
 }
示例#11
0
        public void MaskParser_IsEqualNumberOfSplitsInMaskAndFileName_ReturnTrue()
        {
            // arrange
            var _expectedMask = "{track}.{artist}.{title}";
            var parser = new MaskParser(_expectedMask);

            // act
            var actual = parser.IsEqualNumberOfSplitsInMaskAndFileName(".", "Alla.Pop.Arlekino");

            // assert
            Assert.IsTrue(actual);
        }