|
|
|
@ -11,26 +11,52 @@ namespace TestUnitaires
|
|
|
|
|
public class TU_Manager
|
|
|
|
|
{
|
|
|
|
|
[Theory]
|
|
|
|
|
[InlineData(null)]
|
|
|
|
|
[InlineData("Réference")]
|
|
|
|
|
public void TU_Methods(string? test)
|
|
|
|
|
{
|
|
|
|
|
Playlist p = new Playlist(test, "PlaceHolder", "place.holder");
|
|
|
|
|
Album album = new Album(test, "place.holder", new Artist("test"), "PlaceHolder", "PlaceHolder");
|
|
|
|
|
CustomTitle t = new CustomTitle(test, "test. mp3", "Banger", "path");
|
|
|
|
|
Artist artist = new Artist(test);
|
|
|
|
|
Manager m = new Manager(new LinqXmlSerialization(Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "Data")));
|
|
|
|
|
InfoTitle info = new InfoTitle(test, "url.test", "infos", "desc", Genre.POP, 345);
|
|
|
|
|
/*Assert.NotEmpty(m.Albums);
|
|
|
|
|
Assert.NotEmpty(m.Artists);
|
|
|
|
|
Assert.NotEmpty(m.InfoTitles);
|
|
|
|
|
Assert.NotEmpty(m.Playlists);
|
|
|
|
|
Assert.NotEmpty(m.CustomTitles);*/
|
|
|
|
|
m.AddCustomTitle(t);
|
|
|
|
|
m.AddPlaylist(p);
|
|
|
|
|
m.AddAlbum(album);
|
|
|
|
|
m.AddArtist(artist);
|
|
|
|
|
m.AddInfoTitle(info);
|
|
|
|
|
Assert.Contains(t, m.CustomTitles);
|
|
|
|
|
Assert.Contains(album, m.Albums);
|
|
|
|
|
Assert.Contains(p, m.Playlists);
|
|
|
|
|
Assert.Contains(info, m.InfoTitles);
|
|
|
|
|
Assert.Contains(artist, m.Artists);
|
|
|
|
|
m.RemovePlaylist(p);
|
|
|
|
|
m.RemoveAlbum(album);
|
|
|
|
|
m.RemoveCustomTitle(t);
|
|
|
|
|
m.RemoveInfoTitle(info);
|
|
|
|
|
Assert.DoesNotContain(t, m.CustomTitles);
|
|
|
|
|
Assert.DoesNotContain(p, m.Playlists);
|
|
|
|
|
Assert.DoesNotContain(album, m.Albums);
|
|
|
|
|
Assert.DoesNotContain(info,m.InfoTitles);
|
|
|
|
|
m.AddCustomTitle(t);
|
|
|
|
|
m.AddPlaylist(p);
|
|
|
|
|
m.AddAlbum(album);
|
|
|
|
|
m.AddArtist(artist);
|
|
|
|
|
m.AddInfoTitle(info);
|
|
|
|
|
Assert.Equal(m.GetAlbums(), m.Albums);
|
|
|
|
|
Assert.Equal(m.GetInfoTitles(), m.InfoTitles);
|
|
|
|
|
Assert.Equal(m.GetCustomTitles(), m.CustomTitles);
|
|
|
|
|
Assert.Equal(m.GetPlaylists(), m.Playlists);
|
|
|
|
|
Assert.Equal(m.GetArtists(), m.Artists);
|
|
|
|
|
Assert.Equal(m.GetAlbumByName(test), album);
|
|
|
|
|
Assert.Equal(m.GetPlaylistByName(test), p);
|
|
|
|
|
Assert.Equal(m.GetInfoTitleByName(test), info);
|
|
|
|
|
Assert.Equal(m.GetArtistByName(test), artist);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|