public void MapEntityToModelList() { var mapper = new DALQuoteTweetMapper(); QuoteTweet item = new QuoteTweet(); item.SetProperties(1, "A", DateTime.Parse("1/1/1987 12:00:00 AM"), 1, 1, TimeSpan.Parse("01:00:00")); List <ApiQuoteTweetServerResponseModel> response = mapper.MapEntityToModel(new List <QuoteTweet>() { { item } }); response.Count.Should().Be(1); }
public virtual QuoteTweet MapBOToEF( BOQuoteTweet bo) { QuoteTweet efQuoteTweet = new QuoteTweet(); efQuoteTweet.SetProperties( bo.Content, bo.Date, bo.QuoteTweetId, bo.RetweeterUserId, bo.SourceTweetId, bo.Time); return(efQuoteTweet); }
public void MapEFToBOList() { var mapper = new DALQuoteTweetMapper(); QuoteTweet entity = new QuoteTweet(); entity.SetProperties("A", DateTime.Parse("1/1/1987 12:00:00 AM"), 1, 1, 1, TimeSpan.Parse("0")); List <BOQuoteTweet> response = mapper.MapEFToBO(new List <QuoteTweet>() { entity }); response.Count.Should().Be(1); }
public void MapEntityToModel() { var mapper = new DALQuoteTweetMapper(); QuoteTweet item = new QuoteTweet(); item.SetProperties(1, "A", DateTime.Parse("1/1/1987 12:00:00 AM"), 1, 1, TimeSpan.Parse("01:00:00")); ApiQuoteTweetServerResponseModel response = mapper.MapEntityToModel(item); response.Content.Should().Be("A"); response.Date.Should().Be(DateTime.Parse("1/1/1987 12:00:00 AM")); response.QuoteTweetId.Should().Be(1); response.RetweeterUserId.Should().Be(1); response.SourceTweetId.Should().Be(1); response.Time.Should().Be(TimeSpan.Parse("01:00:00")); }
public void MapEFToBO() { var mapper = new DALQuoteTweetMapper(); QuoteTweet entity = new QuoteTweet(); entity.SetProperties("A", DateTime.Parse("1/1/1987 12:00:00 AM"), 1, 1, 1, TimeSpan.Parse("0")); BOQuoteTweet response = mapper.MapEFToBO(entity); response.Content.Should().Be("A"); response.Date.Should().Be(DateTime.Parse("1/1/1987 12:00:00 AM")); response.QuoteTweetId.Should().Be(1); response.RetweeterUserId.Should().Be(1); response.SourceTweetId.Should().Be(1); response.Time.Should().Be(TimeSpan.Parse("0")); }
public virtual QuoteTweet MapModelToEntity( int quoteTweetId, ApiQuoteTweetServerRequestModel model ) { QuoteTweet item = new QuoteTweet(); item.SetProperties( quoteTweetId, model.Content, model.Date, model.RetweeterUserId, model.SourceTweetId, model.Time); return(item); }