예제 #1
0
        private MatchDayPlayer GetMatchDayPlayer()
        {
            var players  = GetPlayerQuery().ToArray();
            var matchDay = GetMatchDay();

            var matchDayPlayer = new MatchDayPlayer
            {
                Player     = players[0],
                PlayerId   = players[0].Id,
                MatchDay   = matchDay,
                MatchDayId = matchDay.Id
            };


            return(matchDayPlayer);
        }
예제 #2
0
        public void MatchDayPlayerMapsToPlayerResponse()
        {
            var mapper = this.provider.GetService <IMapper>();
            var player = GetPlayerQuery().ToList()[0];

            var matchDayPlayer = new MatchDayPlayer
            {
                MatchDay   = new MatchDay(),
                MatchDayId = "1",
                Player     = player,
                PlayerId   = player.Id
            };

            var playerResponse = mapper.Map <PlayerResponse>(matchDayPlayer);

            playerResponse.Should().NotBeNull();
            playerResponse.FirstName.Should().Be(player.FirstName);
            playerResponse.LastName.Should().Be(player.LastName);
            playerResponse.Handicap.Should().Be(player.Handicap);
            playerResponse.Id.Should().Be(player.Id);
            playerResponse.TenantId.Should().Be(player.TenantId);
        }