public virtual Breed MapBOToEF( BOBreed bo) { Breed efBreed = new Breed(); efBreed.SetProperties( bo.Id, bo.Name); return(efBreed); }
public void MapEFToBO() { var mapper = new DALBreedMapper(); Breed entity = new Breed(); entity.SetProperties(1, "A"); BOBreed response = mapper.MapEFToBO(entity); response.Id.Should().Be(1); response.Name.Should().Be("A"); }
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); }
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); }
public virtual Breed MapModelToEntity( int id, ApiBreedServerRequestModel model ) { Breed item = new Breed(); item.SetProperties( id, model.Name, model.SpeciesId); return(item); }
public void MapEFToBOList() { var mapper = new DALBreedMapper(); Breed entity = new Breed(); entity.SetProperties(1, "A"); List <BOBreed> response = mapper.MapEFToBO(new List <Breed>() { entity }); response.Count.Should().Be(1); }