Beispiel #1
0
        protected async Task InitializeDatabase(string databaseName)
        {
            var fakeDatabase = new FakeInstemDbContext(databaseName);

            await AddFakeMovies(fakeDatabase);

            Database = fakeDatabase.Data;
        }
Beispiel #2
0
 private static async Task AddFakeMovies(FakeInstemDbContext fakeDb)
 => await fakeDb.Add(new Movie
 {
     Id        = 1,
     Title     = "Test Movie",
     Year      = 2020,
     MovieInfo = new MovieInfo
     {
         ImageUrl = "https://www.instem.com/images/style/logo.png"
     }
 },
                     new Movie
 {
     Id        = 10,
     Title     = "Test Movie",
     Year      = 2020,
     MovieInfo = new MovieInfo
     {
         ImageUrl = "https://www.instem.com/images/style/logo.png"
     }
 },
                     new Movie
 {
     Id        = 11,
     Title     = "Test Movie",
     Year      = 2020,
     MovieInfo = new MovieInfo
     {
         ImageUrl = "https://www.instem.com/images/style/logo.png"
     }
 },
                     new Movie
 {
     Id        = 12,
     Title     = "Test Movie",
     Year      = 2020,
     MovieInfo = new MovieInfo
     {
         ImageUrl = "https://www.instem.com/images/style/logo.png"
     }
 },
                     new Director
 {
     Id   = 1,
     Name = "Roman Polanski"
 },
                     new Actor
 {
     Id   = 1,
     Name = "Robert De Niro"
 });