Esempio n. 1
0
        public void MapEntityToModelList()
        {
            var         mapper = new DALDirectTweetMapper();
            DirectTweet item   = new DirectTweet();

            item.SetProperties(1, "A", DateTime.Parse("1/1/1987 12:00:00 AM"), 1, TimeSpan.Parse("01:00:00"));
            List <ApiDirectTweetServerResponseModel> response = mapper.MapEntityToModel(new List <DirectTweet>()
            {
                { item }
            });

            response.Count.Should().Be(1);
        }
Esempio n. 2
0
        public void MapModelToEntity()
        {
            var mapper = new DALDirectTweetMapper();
            ApiDirectTweetServerRequestModel model = new ApiDirectTweetServerRequestModel();

            model.SetProperties("A", DateTime.Parse("1/1/1987 12:00:00 AM"), 1, TimeSpan.Parse("01:00:00"));
            DirectTweet response = mapper.MapModelToEntity(1, model);

            response.Content.Should().Be("A");
            response.Date.Should().Be(DateTime.Parse("1/1/1987 12:00:00 AM"));
            response.TaggedUserId.Should().Be(1);
            response.Time.Should().Be(TimeSpan.Parse("01:00:00"));
        }
Esempio n. 3
0
        public void MapEntityToModel()
        {
            var         mapper = new DALDirectTweetMapper();
            DirectTweet item   = new DirectTweet();

            item.SetProperties(1, "A", DateTime.Parse("1/1/1987 12:00:00 AM"), 1, TimeSpan.Parse("01:00:00"));
            ApiDirectTweetServerResponseModel response = mapper.MapEntityToModel(item);

            response.Content.Should().Be("A");
            response.Date.Should().Be(DateTime.Parse("1/1/1987 12:00:00 AM"));
            response.TaggedUserId.Should().Be(1);
            response.Time.Should().Be(TimeSpan.Parse("01:00:00"));
            response.TweetId.Should().Be(1);
        }