CreateHole() public static method

public static CreateHole ( int id ) : BolfTracker.Models.Hole
id int
return BolfTracker.Models.Hole
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_add_hole_statistics()
        {
            var hole = ObjectMother.CreateHole(Int32.MaxValue);

            _holeRepository.Add(hole);

            var holeStatistics = ObjectMother.CreateHoleStatistics(hole);

            _holeStatisticsRepository.Add(holeStatistics);

            Assert.AreNotEqual(0, holeStatistics.Id);
        }
Ejemplo n.º 3
0
        public void Should_be_able_to_get_all_holes()
        {
            var initialCount = _repository.All().Count();

            var hole1 = ObjectMother.CreateHole(Int32.MaxValue);
            var hole2 = ObjectMother.CreateHole(Int32.MaxValue - 1);

            _repository.Add(hole1);
            _repository.Add(hole2);

            Assert.IsTrue(_repository.All().Count() == initialCount + 2);
        }
        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);
        }