public void AddPlaylist() { var options = new DbContextOptionsBuilder <BetterCalmContext>() .UseInMemoryDatabase(databaseName: "MSP.BetterCalmDatabase").Options; var context = new BetterCalmContext(options); context.Add(listPlaylist[0]); context.SaveChanges(); repository = new PlaylistRepository(context); var initial = repository.GetAll().Count(); repository.Add(listPlaylist[1]); var final = repository.GetAll().Count(); context.Database.EnsureDeleted(); Assert.AreEqual(initial + 1, final); }
public void Add(Playlist_Song playsong) { _pr.Add(playsong); }