public void Initializace() { playerName = RandomString(4); playerName2 = RandomString(5); PlayerDAO dao = new PlayerDAO(); Player player = CreatePlayer(); dao.InsertPlayer(player); playerFrom = player; player = CreatePlayer(); player.PlayerName = playerName2; dao.InsertPlayer(player); playerTo = player; }
public void Initialize() { CargoDAO cargoDao = new CargoDAO(); cargo1 = CreateCargo(); cargo2 = CreateCargo(); cargo2.Type = "newtype"; cargoDao.InsertCargo(cargo1); cargoDao.InsertCargo(cargo2); BaseDAO bas = new BaseDAO(); newBase = new Base(); newBase.Planet = "Země"; bas.InsertBase(newBase); PlayerDAO playerDao = new PlayerDAO(); player = CreatePlayer(); playerDao.InsertPlayer(player); SpaceShipDAO shipDao = new SpaceShipDAO(); ship = CreateSpaceShip(); shipDao.InsertSpaceShip(ship); }
public void Initializace() { //Database.SetInitializer(new CreateDatabaseIfNotExists<SpaceTrafficContext>()); PlayerDAO dao = new PlayerDAO(); player = CreatePlayer(); dao.InsertPlayer(player); }
public void RemovePlayerByIdTest() { PlayerDAO dao = new PlayerDAO(); Player player = CreatePlayer(); player.PlayerName = "player2"; dao.InsertPlayer(player); int id = dao.GetPlayerByName("player2").PlayerId; dao.RemovePlayerById(id); Assert.IsNull(dao.GetPlayerById(id)); }
//Método para registrar el usuario y puntaje en la base de datos public static void RegisterPlayer() { foreach (Player user in PlayerDAO.GetPlayers()) { if (user.nickname.Equals(player)) { ScoreDAO.AddScore(scoreBlocks + BonusPoints(), player); return; } } PlayerDAO.InsertPlayer(player); ScoreDAO.AddScore(scoreBlocks + BonusPoints(), player); }
public void InsertPlayerTest() { PlayerDAO dao = new PlayerDAO(); Player player = CreatePlayer(); player.PlayerName = "player2"; bool result = dao.InsertPlayer(player); Assert.IsTrue(result); Player insertPlayer = dao.GetPlayerByName("player2"); dao.RemovePlayerById(insertPlayer.PlayerId); }
public void Initializace() { PlayerDAO dao = new PlayerDAO(); player = CreatePlayer(); dao.InsertPlayer(player); BaseDAO bas = new BaseDAO(); newBase = new Base(); newBase.Planet = "Země"; bas.InsertBase(newBase); }