示例#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
 public Vote AddVote(Vote vote)
 {
     return(VoteRepository.Insert(vote.Map <DbVote>()).Map <Vote>());
 }