Пример #1
0
        public void SuccessfulRenaming()
        {
            var artist = "SomeFamousArtist";
            var title  = "LovelySong";

            var mp3File = new MP3FileForTest(artist: artist, title: title);
            var renamer = new ToFileNameRenamer();

            var isSuccessful = renamer.Rename(mp3File);

            Assert.IsTrue(isSuccessful);

            var expectedName = artist + " - " + title;
            var actual       = mp3File.Name;

            Assert.AreEqual(expectedName, actual);
        }
Пример #2
0
        public void FailedRenaming()
        {
            var artist = "SomeFamousArtist";
            var title  = "";
            var name   = "oldName";

            var mp3File = new MP3FileForTest(name: name, artist: artist, title: title);
            var renamer = new ToFileNameRenamer();

            var isSuccessful = renamer.Rename(mp3File);

            Assert.IsFalse(isSuccessful);

            var expectedName = name;
            var actual       = mp3File.Name;

            Assert.AreEqual(expectedName, actual);
        }