CreatePlayer() public static method

public static CreatePlayer ( ) : BolfTracker.Models.Player
return BolfTracker.Models.Player
Ejemplo n.º 1
0
        public void Should_be_able_to_add_player_rivalry_statistics()
        {
            var game = ObjectMother.CreateGame();

            _gameRepository.Add(game);

            var player         = ObjectMother.CreatePlayer();
            var affectedPlayer = ObjectMother.CreatePlayer();

            _playerRepository.Add(player);
            _playerRepository.Add(affectedPlayer);

            var hole = ObjectMother.CreateHole(Int32.MaxValue);

            _holeRepository.Add(hole);

            var shotType = ObjectMother.CreateShotType();

            _shotTypeRepository.Add(shotType);

            var playerRivalryStatistics = ObjectMother.CreatePlayerRivalryStatistics(game, player, affectedPlayer, hole, shotType);

            _playerRivalryStatisticsRepository.Add(playerRivalryStatistics);

            Assert.AreNotEqual(0, playerRivalryStatistics.Id);
        }
Ejemplo n.º 2
0
        public void Should_be_able_to_get_player_by_name()
        {
            var player = ObjectMother.CreatePlayer();

            _repository.Add(player);

            Assert.IsNotNull(_repository.GetByName(player.Name));
        }
Ejemplo n.º 3
0
        public void Should_be_able_to_add_player()
        {
            var player = ObjectMother.CreatePlayer();

            _repository.Add(player);

            Assert.AreNotEqual(0, player.Id);
        }
        public void Should_be_able_to_add_player_statistics()
        {
            var player = ObjectMother.CreatePlayer();

            _playerRepository.Add(player);

            var playerStatistics = ObjectMother.CreatePlayerStatistics(player);

            _playerStatisticsRepository.Add(playerStatistics);

            Assert.AreNotEqual(0, playerStatistics.Id);
        }
        public void Should_be_able_to_add_ranking()
        {
            var player = ObjectMother.CreatePlayer();

            _playerRepository.Add(player);

            var ranking = ObjectMother.CreateRanking(player);

            _rankingRepository.Add(ranking);

            Assert.AreNotEqual(0, ranking.Id);
        }
Ejemplo n.º 6
0
        public void Should_be_able_to_get_all_players()
        {
            var initialCount = _repository.All().Count();

            var player1 = ObjectMother.CreatePlayer();
            var player2 = ObjectMother.CreatePlayer();

            _repository.Add(player1);
            _repository.Add(player2);

            Assert.IsTrue(_repository.All().Count() == initialCount + 2);
        }
Ejemplo n.º 7
0
        public void Should_be_able_to_add_player_hole_statistics()
        {
            var player = ObjectMother.CreatePlayer();

            _playerRepository.Add(player);

            var hole = ObjectMother.CreateHole(Int32.MaxValue);

            _holeRepository.Add(hole);

            var playerHoleStatistics = ObjectMother.CreatePlayerHoleStatistics(player, hole);

            _playerHoleStatisticsRepository.Add(playerHoleStatistics);

            Assert.AreNotEqual(0, playerHoleStatistics.Id);
        }
Ejemplo n.º 8
0
        public void ShouldBeAbleToAddPlayerGameStatistics()
        {
            var game = ObjectMother.CreateGame();

            _gameRepository.Add(game);

            var player = ObjectMother.CreatePlayer();

            _playerRepository.Add(player);

            var playerGameStatistics = ObjectMother.CreatePlayerGameStatistics(game, player);

            _playerGameStatisticsRepository.Add(playerGameStatistics);

            Assert.AreNotEqual(0, playerGameStatistics.Id);
        }
Ejemplo n.º 9
0
        public void ShouldBeAbleToDeletePlayerGameStatistics()
        {
            var game = ObjectMother.CreateGame();

            _gameRepository.Add(game);

            var player = ObjectMother.CreatePlayer();

            _playerRepository.Add(player);

            var playerGameStatistics = ObjectMother.CreatePlayerGameStatistics(game, player);

            _playerGameStatisticsRepository.Add(playerGameStatistics);
            _playerGameStatisticsRepository.Delete(playerGameStatistics);

            Assert.IsNotNull(_gameRepository.GetById(game.Id));
            Assert.IsNull(_playerGameStatisticsRepository.GetById(playerGameStatistics.Id));
        }
        public void Should_be_able_to_add_score()
        {
            var game = ObjectMother.CreateGame();

            _gameRepository.Add(game);

            var player = ObjectMother.CreatePlayer();

            _playerRepository.Add(player);

            var shotType = ObjectMother.CreateShotType();

            _shotTypeRepository.Add(shotType);

            var hole = ObjectMother.CreateHole(Int32.MaxValue);

            _holeRepository.Add(hole);

            var shot = ObjectMother.CreateShot(game, player, shotType, hole);

            _shotRepository.Add(shot);

            Assert.AreNotEqual(0, shot.Id);
        }