public void GivenWarContestantWithScore_Map_ReturnsModelContestantWithScore()
        {
            // Arrange
            var mapper = new Mapper();

            War.RankingServices.ContestantWithScore source = new War.RankingServices.ContestantWithScore
            {
                Contestant = ContestantMapperTests.CreateTestContestant(),
                Score      = 1234
            };

            // Act
            var target = mapper.Map <War.RankingServices.ContestantWithScore, ContestantWithScore>(source);

            // Assert
            ContestantMapperTests.VerifyContestantMapped(source.Contestant, target.Contestant);
            target.Score.Should().Be(source.Score);
        }
Exemplo n.º 2
0
        public void GivenWarMatchWithContestants_Map_ReturnsModelMatch()
        {
            // Arrange
            var mapper = new Mapper();
            var source = new MatchWithContestants
            {
                Id          = Guid.NewGuid(),
                Contestant1 = ContestantMapperTests.CreateTestContestant(),
                Contestant2 = ContestantMapperTests.CreateTestContestant()
            };

            // Act
            var target = mapper.Map <MatchWithContestants, Match>(source);

            // Assert
            target.Id.Should().Be(source.Id);
            ContestantMapperTests.VerifyContestantMapped(source.Contestant1, target.Contestant1);
            ContestantMapperTests.VerifyContestantMapped(source.Contestant2, target.Contestant2);
        }