コード例 #1
0
        public void MapEntityToModelList()
        {
            var        mapper = new DALCallPersonMapper();
            CallPerson item   = new CallPerson();

            item.SetProperties(1, "A", 1, 1);
            List <ApiCallPersonServerResponseModel> response = mapper.MapEntityToModel(new List <CallPerson>()
            {
                { item }
            });

            response.Count.Should().Be(1);
        }
コード例 #2
0
        public void MapEntityToModel()
        {
            var        mapper = new DALCallPersonMapper();
            CallPerson item   = new CallPerson();

            item.SetProperties(1, "A", 1, 1);
            ApiCallPersonServerResponseModel response = mapper.MapEntityToModel(item);

            response.Id.Should().Be(1);
            response.Note.Should().Be("A");
            response.PersonId.Should().Be(1);
            response.PersonTypeId.Should().Be(1);
        }
コード例 #3
0
        public virtual CallPerson MapModelToEntity(
            int id,
            ApiCallPersonServerRequestModel model
            )
        {
            CallPerson item = new CallPerson();

            item.SetProperties(
                id,
                model.Note,
                model.PersonId,
                model.PersonTypeId);
            return(item);
        }