public void MapEntityToModelList() { var mapper = new DALMessengerMapper(); Messenger item = new Messenger(); item.SetProperties(1, DateTime.Parse("1/1/1987 12:00:00 AM"), 1, 1, TimeSpan.Parse("01:00:00"), 1, 1); List <ApiMessengerServerResponseModel> response = mapper.MapEntityToModel(new List <Messenger>() { { item } }); response.Count.Should().Be(1); }
public void MapModelToEntity() { var mapper = new DALMessengerMapper(); ApiMessengerServerRequestModel model = new ApiMessengerServerRequestModel(); model.SetProperties(DateTime.Parse("1/1/1987 12:00:00 AM"), 1, 1, TimeSpan.Parse("01:00:00"), 1, 1); Messenger response = mapper.MapModelToEntity(1, model); response.Date.Should().Be(DateTime.Parse("1/1/1987 12:00:00 AM")); response.FromUserId.Should().Be(1); response.MessageId.Should().Be(1); response.Time.Should().Be(TimeSpan.Parse("01:00:00")); response.ToUserId.Should().Be(1); response.UserId.Should().Be(1); }
public void MapEntityToModel() { var mapper = new DALMessengerMapper(); Messenger item = new Messenger(); item.SetProperties(1, DateTime.Parse("1/1/1987 12:00:00 AM"), 1, 1, TimeSpan.Parse("01:00:00"), 1, 1); ApiMessengerServerResponseModel response = mapper.MapEntityToModel(item); response.Date.Should().Be(DateTime.Parse("1/1/1987 12:00:00 AM")); response.FromUserId.Should().Be(1); response.Id.Should().Be(1); response.MessageId.Should().Be(1); response.Time.Should().Be(TimeSpan.Parse("01:00:00")); response.ToUserId.Should().Be(1); response.UserId.Should().Be(1); }