Example #1
0
        public void MapModelToEntity()
        {
            var mapper = new DALSelfReferenceMapper();
            ApiSelfReferenceServerRequestModel model = new ApiSelfReferenceServerRequestModel();

            model.SetProperties(1, 1);
            SelfReference response = mapper.MapModelToEntity(1, model);

            response.SelfReferenceId.Should().Be(1);
            response.SelfReferenceId2.Should().Be(1);
        }
Example #2
0
        public void MapEntityToModel()
        {
            var           mapper = new DALSelfReferenceMapper();
            SelfReference item   = new SelfReference();

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

            response.Id.Should().Be(1);
            response.SelfReferenceId.Should().Be(1);
            response.SelfReferenceId2.Should().Be(1);
        }
Example #3
0
        public void MapEntityToModelList()
        {
            var           mapper = new DALSelfReferenceMapper();
            SelfReference item   = new SelfReference();

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

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