public void MapEntityToModelList() { var mapper = new DALTweetMapper(); Tweet item = new Tweet(); item.SetProperties(1, "A", DateTime.Parse("1/1/1987 12:00:00 AM"), 1, TimeSpan.Parse("01:00:00"), 1); List <ApiTweetServerResponseModel> response = mapper.MapEntityToModel(new List <Tweet>() { { item } }); response.Count.Should().Be(1); }
public void MapModelToEntity() { var mapper = new DALTweetMapper(); ApiTweetServerRequestModel model = new ApiTweetServerRequestModel(); model.SetProperties("A", DateTime.Parse("1/1/1987 12:00:00 AM"), 1, TimeSpan.Parse("01:00:00"), 1); Tweet response = mapper.MapModelToEntity(1, model); response.Content.Should().Be("A"); response.Date.Should().Be(DateTime.Parse("1/1/1987 12:00:00 AM")); response.LocationId.Should().Be(1); response.Time.Should().Be(TimeSpan.Parse("01:00:00")); response.UserUserId.Should().Be(1); }
public void MapEntityToModel() { var mapper = new DALTweetMapper(); Tweet item = new Tweet(); item.SetProperties(1, "A", DateTime.Parse("1/1/1987 12:00:00 AM"), 1, TimeSpan.Parse("01:00:00"), 1); ApiTweetServerResponseModel response = mapper.MapEntityToModel(item); response.Content.Should().Be("A"); response.Date.Should().Be(DateTime.Parse("1/1/1987 12:00:00 AM")); response.LocationId.Should().Be(1); response.Time.Should().Be(TimeSpan.Parse("01:00:00")); response.TweetId.Should().Be(1); response.UserUserId.Should().Be(1); }