public FilmsController() { string connectionString = "server=localhost;port=3306;database=sakila;userid=DataAccess;pwd=Da.2019.IEGP;sslmode=none"; dbContext = SakilaDbContextFactory.Create(connectionString); }
public ActorsController() { // string connectionString = "server=localhost;port=3306;database=sakila;userid=admin;pwd=arnoboy11;sslmode=none"; string connectionString = "server=192.168.100.13;port=3306;database=sakila;userid=admin;pwd=arnoboy11"; dbContext = SakilaDbContextFactory.Create(connectionString); }
public FilmsController() { string connectionString = "server=localhost;port=3306;database=sakila;userid=root;pwd=123456"; dbContext = SakilaDbContextFactory.Create(connectionString); }
private ICityService getCityService() { DbContextOptions options = MySqlDbContextOptionsExtensions.UseMySql(new DbContextOptionsBuilder(), ConnectionString).Options; SakilaDbContext ctx = new SakilaDbContext(options); ICityService cityService = new CityService(ctx); return(cityService); }
public void testFindById() { DbContextOptions options = MySqlDbContextOptionsExtensions.UseMySql(new DbContextOptionsBuilder(), ConnectionString).Options; SakilaDbContext ctx = new SakilaDbContext(options); IFilmService filmService = new FilmService(ctx); Film film = filmService.findById(83); Assert.Equal("BLUES INSTINCT", film.Title); }
public void testListAll() { DbContextOptions options = MySqlDbContextOptionsExtensions.UseMySql(new DbContextOptionsBuilder(), ConnectionString).Options; SakilaDbContext ctx = new SakilaDbContext(options); IFilmService filmService = new FilmService(ctx); List <Film> filmsList = filmService.listAll(); Assert.Equal(1000, filmsList.Count); }
public void testListAll() { // restauração do banco DbContextOptions options = MySqlDbContextOptionsExtensions .UseMySql(new DbContextOptionsBuilder(), "server=172.16.99.230;userid=root;pwd=1q2w3e4r;port=3308;database=sakila;sslmode=none;").Options; SakilaDbContext ctx = new SakilaDbContext(options); filmService = new FilmService(ctx); var list = filmService.listAll(); Assert.Equal(1000, list.Count); Assert.NotNull(list[45].Language); }
public void testSaveOrUpdate_atualizacao() { DbContextOptions options = MySqlDbContextOptionsExtensions.UseMySql(new DbContextOptionsBuilder(), ConnectionString).Options; SakilaDbContext ctx = new SakilaDbContext(options); IFilmService filmService = new FilmService(ctx); Film film = new Film() { Id = 2, Title = "Filme Teste2", Description = "Description2", ReleaseYear = 2019 }; filmService.saveOrUpdate(film); Assert.Equal("Filme Teste2", filmService.findById(2).Title); }
public void testSaveOrUpdate_insercao() { DbContextOptions options = MySqlDbContextOptionsExtensions.UseMySql(new DbContextOptionsBuilder(), ConnectionString).Options; SakilaDbContext ctx = new SakilaDbContext(options); IFilmService filmService = new FilmService(ctx); Film film = new Film() { Title = "Filme Teste", Description = "Description", ReleaseYear = 2018 }; filmService.saveOrUpdate(film); Assert.Equal(film, filmService.findById(1001)); Assert.Equal(1001, filmService.listAll().Count); }
public ActorsController() { string connectionString = "server=localhost;port=3306;database=sakila;userid=root;pwd=ks7r2400;sslmode=none"; dbContext = SakilaDbContextFactory.Create(connectionString); }
public FilmActorsController(SakilaDbContext context) { _context = context; }
public InventoriesController(SakilaDbContext context) { _context = context; }
public FilmService(SakilaDbContext dbContext) { this.dbContext = dbContext; }
public ActorsController(SakilaDbContext dbContext) { dataBaseContext = dbContext; }
public RentalsController(SakilaDbContext context) { _context = context; }
public CityService(SakilaDbContext ctx) { this.ctx = ctx; }
public CustomerService(SakilaDbContext ctx) { this.ctx = ctx; }
public FilmService(SakilaDbContext ctx) { this.ctx = ctx; }
public CustomersController(SakilaDbContext context) { _context = context; }
public LanguageService(SakilaDbContext context) { this.context = context; }
public AtorController() { string connectionString = "server=localhost;port=3306;database=sakila_tiagopassos;userid=root;pwd=;sslmode=none"; dbContext = SakilaDbContextFactory.Create(connectionString); }