Пример #1
0
        public void    GetListofPlaylistbyUserId()
        {
            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.GetAllPlaylistByUserId(1);

                Assert.AreEqual(2, playlist.Count);

                context.Dispose();
            }
        }