예제 #1
0
        public void Map_MapsAllProperties()
        {
            // Arrange
            var vote            = new Vote();
            var votingCandidate = new VotingCandidate();
            var userIdentifier  = Guid.NewGuid();

            // Act
            vote.Map(votingCandidate, userIdentifier);

            // Assert
            Assert.That(vote.VotingCandidateId, Is.EqualTo(votingCandidate.Id));
            Assert.That(vote.VotingCandidate, Is.EqualTo(votingCandidate));
            Assert.That(vote.UserIdentifier, Is.EqualTo(userIdentifier));
        }
예제 #2
0
파일: VoteService.cs 프로젝트: Yogso92/R8It
 public Vote AddVote(Vote vote)
 {
     return(VoteRepository.Insert(vote.Map <DbVote>()).Map <Vote>());
 }