public void GivenPlayerDoesNotExist(string playerName) { var names = SpecsHelper.SplitFullNameToFirstLastNames(playerName); _player.FirstName = names.FirstName; _player.LastName = names.LastName; }
public void GivenPlayerExists(string fullPlayerName) { var names = SpecsHelper.SplitFullNameToFirstLastNames(fullPlayerName); _player.FirstName = names.FirstName; _player.LastName = names.LastName; TestDbAdapter.CreatePlayer(_player); }
public void GivenIHaveRemovedPlayer(string playerName) { var names = SpecsHelper.SplitFullNameToFirstLastNames(playerName); _playersToRemove.Add(new PlayerId(_createdPlayers .FirstOrDefault(x => { return(x.LastName != null && (x.FirstName == names.FirstName && x.LastName == names.LastName)); }).Id)); }
public void GivenCaptainIsChangedToAnother(string captainName) { var names = SpecsHelper.SplitFullNameToFirstLastNames(captainName); _captain = new PlayerEntity { FirstName = names.FirstName, LastName = names.LastName, }; TestDbAdapter.CreatePlayer(_captain); _team.Players.Add(_captain); }
public void GivenPlayerExists(string fullPlayerName) { var names = SpecsHelper.SplitFullNameToFirstLastNames(fullPlayerName); var player = new PlayerEntity { FirstName = names.FirstName, LastName = names.LastName }; TestDbAdapter.CreatePlayer(player); _playerId = player.Id; }
public void GivenIHavePlayerAsATeamPlayer(string playerName) { var names = SpecsHelper.SplitFullNameToFirstLastNames(playerName); var newPlayer = new PlayerEntity { FirstName = names.FirstName, LastName = names.LastName }; TestDbAdapter.CreatePlayer(newPlayer); _playerToAdd.Add(new PlayerId(newPlayer.Id)); }
private void RegisterNewPlayerAndSetCaptainId(string fullName) { var names = SpecsHelper.SplitFullNameToFirstLastNames(fullName); var newPlayer = new PlayerEntity { FirstName = names.FirstName, LastName = names.LastName }; TestDbAdapter.CreatePlayer(newPlayer); _captainId = newPlayer.Id; }
public void GivenPlayerIsATeamPlayer(string playerName) { var names = SpecsHelper.SplitFullNameToFirstLastNames(playerName); var newPlayer = new PlayerEntity { FirstName = names.FirstName, LastName = names.LastName }; TestDbAdapter.CreatePlayer(newPlayer); TestDbAdapter.AssignPlayerToTeam(newPlayer.Id, _teamId.Id); _createdPlayers.Add(newPlayer); }
public void GivenIsATeamCaptain(string playerName) { var names = SpecsHelper.SplitFullNameToFirstLastNames(playerName); using (var ctx = TestDbAdapter.Context) { var playerEntity = ctx.Players .SingleOrDefault(p => p.Id == _captainId.Id); if (playerEntity == null) { return; } playerEntity.FirstName = names.FirstName; playerEntity.LastName = names.LastName; ctx.SaveChanges(); _createdPlayers.Add(playerEntity); } }