Esempio n. 1
0
        public void EditTitlePlaylist()
        {
            string titleofPlaylist = "Mafia Collection";
            int    id = 4;

            var options = new DbContextOptionsBuilder <FlixContext>()
                          .UseInMemoryDatabase(databaseName: "FlixUsersDatabase")
                          .Options;


            // Use a clean instance of the context to run the test
            using (var context = new FlixContext(options))
            {
                PlaylistRepository userRepo = new PlaylistRepository(context);
                var playlist = userRepo.EditPlayList(titleofPlaylist, id);
                var findId   = userRepo.GetPlaylistById(4);

                Assert.AreEqual(titleofPlaylist, findId.Title);

                context.Dispose();
            }
        }