예제 #1
0
        public void MapEntityToModelList()
        {
            var  mapper = new DALVoteMapper();
            Vote item   = new Vote();

            item.SetProperties(1, 1, DateTime.Parse("1/1/1987 12:00:00 AM"), 1, 1, 1);
            List <ApiVoteServerResponseModel> response = mapper.MapEntityToModel(new List <Vote>()
            {
                { item }
            });

            response.Count.Should().Be(1);
        }
예제 #2
0
        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);
        }
예제 #3
0
        public void MapEntityToModel()
        {
            var  mapper = new DALVoteMapper();
            Vote item   = new Vote();

            item.SetProperties(1, 1, DateTime.Parse("1/1/1987 12:00:00 AM"), 1, 1, 1);
            ApiVoteServerResponseModel response = mapper.MapEntityToModel(item);

            response.BountyAmount.Should().Be(1);
            response.CreationDate.Should().Be(DateTime.Parse("1/1/1987 12:00:00 AM"));
            response.Id.Should().Be(1);
            response.PostId.Should().Be(1);
            response.UserId.Should().Be(1);
            response.VoteTypeId.Should().Be(1);
        }