示例#1
0
        public void MapEntityToModel()
        {
            var mapper = new DALOfficerCapabilitiesMapper();
            OfficerCapabilities item = new OfficerCapabilities();

            item.SetProperties(1, 1, 1);
            ApiOfficerCapabilitiesServerResponseModel response = mapper.MapEntityToModel(item);

            response.CapabilityId.Should().Be(1);
            response.Id.Should().Be(1);
            response.OfficerId.Should().Be(1);
        }
        public virtual OfficerCapabilities MapModelToEntity(
            int id,
            ApiOfficerCapabilitiesServerRequestModel model
            )
        {
            OfficerCapabilities item = new OfficerCapabilities();

            item.SetProperties(
                id,
                model.CapabilityId,
                model.OfficerId);
            return(item);
        }
示例#3
0
        public void MapEntityToModelList()
        {
            var mapper = new DALOfficerCapabilitiesMapper();
            OfficerCapabilities item = new OfficerCapabilities();

            item.SetProperties(1, 1, 1);
            List <ApiOfficerCapabilitiesServerResponseModel> response = mapper.MapEntityToModel(new List <OfficerCapabilities>()
            {
                { item }
            });

            response.Count.Should().Be(1);
        }