Beispiel #1
0
        public void MapModelToEntity()
        {
            var mapper = new DALBreedMapper();
            ApiBreedServerRequestModel model = new ApiBreedServerRequestModel();

            model.SetProperties("A", 1);
            Breed response = mapper.MapModelToEntity(1, model);

            response.Name.Should().Be("A");
            response.SpeciesId.Should().Be(1);
        }
Beispiel #2
0
        public void MapEntityToModel()
        {
            var   mapper = new DALBreedMapper();
            Breed item   = new Breed();

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

            response.Id.Should().Be(1);
            response.Name.Should().Be("A");
            response.SpeciesId.Should().Be(1);
        }
Beispiel #3
0
        public void MapEntityToModelList()
        {
            var   mapper = new DALBreedMapper();
            Breed item   = new Breed();

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

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