Example #1
0
        public virtual DirectTweet MapBOToEF(
            BODirectTweet bo)
        {
            DirectTweet efDirectTweet = new DirectTweet();

            efDirectTweet.SetProperties(
                bo.Content,
                bo.Date,
                bo.TaggedUserId,
                bo.Time,
                bo.TweetId);
            return(efDirectTweet);
        }
Example #2
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);
        }
Example #3
0
        public void MapEFToBOList()
        {
            var         mapper = new DALDirectTweetMapper();
            DirectTweet entity = new DirectTweet();

            entity.SetProperties("A", DateTime.Parse("1/1/1987 12:00:00 AM"), 1, TimeSpan.Parse("0"), 1);

            List <BODirectTweet> response = mapper.MapEFToBO(new List <DirectTweet>()
            {
                entity
            });

            response.Count.Should().Be(1);
        }
Example #4
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);
        }
Example #5
0
        public void MapEFToBO()
        {
            var         mapper = new DALDirectTweetMapper();
            DirectTweet entity = new DirectTweet();

            entity.SetProperties("A", DateTime.Parse("1/1/1987 12:00:00 AM"), 1, TimeSpan.Parse("0"), 1);

            BODirectTweet response = mapper.MapEFToBO(entity);

            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("0"));
            response.TweetId.Should().Be(1);
        }
Example #6
0
        public virtual DirectTweet MapModelToEntity(
            int tweetId,
            ApiDirectTweetServerRequestModel model
            )
        {
            DirectTweet item = new DirectTweet();

            item.SetProperties(
                tweetId,
                model.Content,
                model.Date,
                model.TaggedUserId,
                model.Time);
            return(item);
        }