public async Task Inicializar() { var _option = new DbContextOptionsBuilder <CoreContext>() .UseInMemoryDatabase(databaseName: Guid.NewGuid().ToString()) .Options; _movimientoRepositorio = new MovimientoRepositorio(new CoreContext(_option)); fakerInicial = new Faker <Movimiento>() .StrictMode(false) .Rules((fake, objeto) => { objeto.Id = fake.IndexGlobal; objeto.OrdenMovimiento = fake.IndexFaker; objeto.JugadorId = fake.Random.Number(10); objeto.PartidaId = (int)fake.Random.UInt(2, 20); objeto.PuntoId = new Randomizer().Replace("?#"); objeto.color = Color.Blanco; }); fakerInicial.UseSeed(1); movimientosIniciales = fakerInicial.Generate(20); await _movimientoRepositorio.AgregarListaAsync(movimientosIniciales); }
public MovimientoService(string connectionString) { conexion = new ConnectionManager(connectionString); movimientoRepositorio = new MovimientoRepositorio(conexion); }