예제 #1
0
        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);
        }
예제 #2
0
 public MovimientoService(string connectionString)
 {
     conexion = new ConnectionManager(connectionString);
     movimientoRepositorio = new MovimientoRepositorio(conexion);
 }