public virtual ApiVoteServerRequestModel MapServerResponseToRequest( ApiVoteServerResponseModel response) { var request = new ApiVoteServerRequestModel(); request.SetProperties( response.BountyAmount, response.CreationDate, response.PostId, response.UserId, response.VoteTypeId); return(request); }
public void MapModelToEntity() { var mapper = new DALVoteMapper(); ApiVoteServerRequestModel model = new ApiVoteServerRequestModel(); model.SetProperties(1, DateTime.Parse("1/1/1987 12:00:00 AM"), 1, 1, 1); Vote response = mapper.MapModelToEntity(1, model); response.BountyAmount.Should().Be(1); response.CreationDate.Should().Be(DateTime.Parse("1/1/1987 12:00:00 AM")); response.PostId.Should().Be(1); response.UserId.Should().Be(1); response.VoteTypeId.Should().Be(1); }