Esempio n. 1
0
        public void DeleteFilesShouldDeleteFilesFromMod()
        {
            var options = new DbContextOptionsBuilder <ApplicationDbContext>()
                          .UseInMemoryDatabase(databaseName: "DeleteFilesShouldDeleteFilesFromMod_DB")
                          .Options;

            var dbContext = new ApplicationDbContext(options);

            var modService = new ModService(dbContext);

            var mod = new Mod();

            dbContext.Mods.Add(mod);
            dbContext.SaveChanges();

            modService.AddFileUrl(mod.Id, null, null, null, 10000000);
            modService.DeleteFiles(mod.Id);

            Assert.Empty(mod.Files);
        }