Ejemplo n.º 1
0
        public void MovieDbContext_Seeding_HasData()
        {
            //Arrange
            using (var db = new MovieDbContext())
            {
                //Act
                db.Database.EnsureDeleted();
                db.Database.Migrate();
                db.Seed();
                var movies = db.Movies.Include(m => m.MovieActors).ToList();
                var actors = db.Actors.Include(a => a.MovieActors).ToList();

                //Assert
                movies.Should().NotBeNullOrEmpty();
                actors.Should().NotBeNullOrEmpty();
            }
        }