public void saveEmptyAlbumTitleTest() { string expected = null; MP3File file = new MP3File("song.mp3"); MP3Api.saveAlbumTitle(file.Path, ""); string actual = (new MP3File("song.mp3")).Tags.Album; Assert.AreEqual(expected, actual, "Album title is not saved correctly"); }
//-----------------------------------file operations-------------------- public void cutFileTo(string path) { System.IO.File.Copy(_file.Path, path, true); deleteTempFile(); _file = new MP3File(path); _isDefault = false; _needBeSaved = false; }
public void saveEmptyLyricsTest() { string expected = null; MP3File file = new MP3File("song.mp3"); MP3Api.saveLyrics(file.Path, ""); string actual = (new MP3File("song.mp3")).Tags.Lyrics; Assert.AreEqual(expected, actual, "Lyrics doesn`t save correctly"); }
public void saveCoverTest() { int expected = 1; MP3File file = new MP3File("song.mp3"); MP3Api.saveCover(file.Path, "cover.jpg"); int actual = (new MP3File("song.mp3")).Tags.Pictures.Length; Assert.AreEqual(expected, actual, "Cover is not saved correctly"); }
public void saveArtistNameTest() { string expected = "My artist"; MP3File file = new MP3File("song.mp3"); MP3Api.saveArtistName(file.Path, "My artist"); string actual = (new MP3File("song.mp3")).Tags.AlbumArtists[(new MP3File("song.mp3")).Tags.AlbumArtists.Length - 1]; Assert.AreEqual(expected, actual, "Artist is not saved correctly"); }
public void constructorTest() { string expected = "song.mp3"; MP3File file = new MP3File("song.mp3"); string actual = file.Path; Assert.AreEqual(expected, actual, "MP3File constructor does not work correctly"); Assert.AreNotEqual(null, file.Tags, "MP3File constructor does not work correctly"); }
public void deleteTempFileTest() { bool expected = true; MP3File file = new MP3File("song.mp3"); MP3Editor editor = new MP3Editor(file); editor.deleteTempFile(); bool actual = System.IO.File.Exists("song.mp3"); Assert.AreEqual(expected, actual, "deleteTempFile method does not work correctly"); }
public void cutFileToTest() { string expected = "song1.mp3"; MP3File file = new MP3File("song.mp3"); MP3Editor editor = new MP3Editor(file); editor.cutFileTo("song1.mp3"); string actual = editor.File.Path; Assert.AreEqual(expected, actual, "cutFileTo method does not work correctly"); }
public void saveAlbumTitleTest() { bool expected = true; MP3File file = new MP3File("song.mp3"); MP3Editor editor = new MP3Editor(file); bool actual = editor.saveAlbumTitle("My album title"); string actualTitle = (new MP3File("song.mp3")).Tags.Album; Assert.AreEqual(expected, actual, "Album title is not saved correctly"); Assert.AreEqual("My album title", actualTitle, "Album title is not saved correctly"); }
public void saveArtistNameTest() { bool expected = true; MP3File file = new MP3File("song.mp3"); MP3Editor editor = new MP3Editor(file); bool actual = editor.saveArtistName("Artist"); bool actualArtist = (new List<string>((new MP3File("song.mp3")).Tags.AlbumArtists)).Contains("Artist"); Assert.AreEqual(expected, actual, "Artist is not saved correctly"); Assert.AreEqual(true, actualArtist, "Artist is not saved correctly"); }
public void cutFileToTest2() { MP3File file = new MP3File("song.mp3"); MP3Editor editor = new MP3Editor(file); editor.cutFileTo(""); }
public void saveTitleTest() { string expected = "My title"; MP3File file = new MP3File("song.mp3"); MP3Api.saveTitle(file.Path, "My title"); string actual = (new MP3File("song.mp3")).Tags.Title; Assert.AreEqual(expected, actual, "Title is not saved correctly"); }
public void saveCoverTest() { bool expected = true; MP3File file = new MP3File("song.mp3"); MP3Editor editor = new MP3Editor(file); bool actual = editor.saveBlackCover(); int actualCoversNum = (new MP3File("song.mp3")).Tags.Pictures.Length; Assert.AreEqual(expected, actual, "Cover is not saved correctly"); Assert.AreEqual(1, actualCoversNum, "Cover is not saved correctly"); }
public void saveEmptyArtistNameTest() { MP3File file = new MP3File("song.mp3"); MP3Api.saveArtistName(file.Path, ""); Assert.AreEqual(0, (new MP3File("song.mp3")).Tags.AlbumArtists.Length, "Artist is not saved correctly"); }
private bool _needBeSaved; //file was modified #endregion Fields #region Constructors public MP3Editor() { _isDefault = true; _file = new MP3File(makeDefaultFileCopy()); _needBeSaved = false; }
public MP3Editor(MP3File file) { _isDefault = false; _file = file; _needBeSaved = false; }
public void saveEmptyTitleTest() { bool expected = true; MP3File file = new MP3File("song.mp3"); MP3Editor editor = new MP3Editor(file); bool actual = editor.saveTitle(""); string actualTitle = (new MP3File("song.mp3")).Tags.Title; Assert.AreEqual(expected, actual, "Title is not saved correctly"); Assert.AreEqual(null, actualTitle, "Title is not saved correctly"); }
public void saveLyricsTest() { bool expected = true; MP3File file = new MP3File("song.mp3"); MP3Editor editor = new MP3Editor(file); bool actual = editor.saveLyrics("Text text"); string actualText = (new MP3File("song.mp3")).Tags.Lyrics; Assert.AreEqual(expected, actual, "Lyrics is not saved correctly"); Assert.AreEqual("Text text", actualText, "Lyrics is not saved correctly"); }
public void saveLyricsTest() { string expected = "Song`s text"; MP3File file = new MP3File("song.mp3"); MP3Api.saveLyrics(file.Path, "Song`s text"); string actual = (new MP3File("song.mp3")).Tags.Lyrics; Assert.AreEqual(expected, actual, "Lyrics is not saved correctly"); }