using Model;
using Model.Serialization;
using Model.Stub;
using Newtonsoft.Json.Linq;
using NuGet.Frameworks;
using System;

namespace TestUnitaires
{

    public class TU_Manager
    {
        [Theory]
        [InlineData(null)]
        [InlineData("Réference")]
        public void TU_Methods(string? test)
        {
            IDataManager DataManager = new LinqXmlSerialization();
            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");
            Manager m = new Manager(DataManager);
            m.AddCustomTitle(t);
            m.AddPlaylist(p);
            m.AddAlbum(album);
            Assert.Contains(t, m.CustomTitles);
            Assert.Contains(album, m.Albums);
            Assert.Contains(p, m.Playlists);
            m.RemovePlaylist(p);
            m.RemoveAlbum(album);
            m.RemoveCustomTitle(t);
            Assert.DoesNotContain(t, m.CustomTitles);
            Assert.DoesNotContain(p, m.Playlists);
            Assert.DoesNotContain(album, m.Albums);
        }
    }
    
}