RetagFile() public method

public RetagFile ( string pattern ) : bool
pattern string
return bool
        public void NotCorrectPatternAddTags()
        {
            var fileHandler = new FileSystemBuilder().
                ActualFile(new FileBuilder().
                    FilePath("myartist - mysong").
                    Tag(FrameType.Artist, "Not my artist").
                    Build()).
                Build();
            var fileProcesor = new Mp3FileProcessor(fileHandler);

            Assert.AreEqual(false, fileProcesor.RetagFile("<ar><ti>"));
        }
Beispiel #2
0
 private static void LaunchRetagMode(string path, string pattern)
 {
     var retager = new Mp3FileProcessor(path);
     retager.RetagFile(pattern);
 }
        public void SimpleAddTagsToNotEmptyFile()
        {
            var fileHandler = new FileSystemBuilder().
                ActualFile(new FileBuilder().
                    FilePath("myartist - mysong").
                    Tag(FrameType.Artist, "Not my artist").
                    Build()).
                Build();
            var fileProcesor = new Mp3FileProcessor(fileHandler);

            var expect = new Dictionary<FrameType, string>
            {
                {FrameType.Artist, "myartist"},
                {FrameType.Title, "mysong"}
            };

            Assert.AreEqual(true, fileProcesor.RetagFile("<ar> - <ti>"));

            CollectionAssert.AreEquivalent(expect, fileHandler.Tags);
        }