public Battle CreateBattle() { var battle = new Battle(DateTime.UtcNow, DateTime.UtcNow, BattleType.FixedBudget, 10000); _repositoryOfBattle.Add(battle); _unitOfWork.SaveChanges(); return battle; }
public long CreateBattle(DateTime startDate, DateTime endDate, BattleType battleType, int budget) { using (var unitOfWorkScope = _unitOfWorkScopeFactory.Create()) { var battle = new Battle(startDate, endDate, battleType, budget); _repositoryOfBattle.Add(battle); unitOfWorkScope.SaveChanges(); return battle.Id; } }
private void SetupBattleAndUserAndTeam(out Battle battle, out Team team, out User user) { battle = _creator.CreateBattle(); user = _creator.CreateUser(); team = _creator.CreateTeam(user); }