Пример #1
0
        public void MapBOToModelList()
        {
            var       mapper = new BOLRetweetMapper();
            BORetweet bo     = new BORetweet();

            bo.SetProperties(1, DateTime.Parse("1/1/1987 12:00:00 AM"), 1, TimeSpan.Parse("0"), 1);
            List <ApiRetweetResponseModel> response = mapper.MapBOToModel(new List <BORetweet>()
            {
                { bo }
            });

            response.Count.Should().Be(1);
        }
Пример #2
0
        public void MapModelToBO()
        {
            var mapper = new BOLRetweetMapper();
            ApiRetweetRequestModel model = new ApiRetweetRequestModel();

            model.SetProperties(DateTime.Parse("1/1/1987 12:00:00 AM"), 1, TimeSpan.Parse("0"), 1);
            BORetweet response = mapper.MapModelToBO(1, model);

            response.Date.Should().Be(DateTime.Parse("1/1/1987 12:00:00 AM"));
            response.RetwitterUserId.Should().Be(1);
            response.Time.Should().Be(TimeSpan.Parse("0"));
            response.TweetTweetId.Should().Be(1);
        }
Пример #3
0
        public void MapBOToModel()
        {
            var       mapper = new BOLRetweetMapper();
            BORetweet bo     = new BORetweet();

            bo.SetProperties(1, DateTime.Parse("1/1/1987 12:00:00 AM"), 1, TimeSpan.Parse("0"), 1);
            ApiRetweetResponseModel response = mapper.MapBOToModel(bo);

            response.Date.Should().Be(DateTime.Parse("1/1/1987 12:00:00 AM"));
            response.Id.Should().Be(1);
            response.RetwitterUserId.Should().Be(1);
            response.Time.Should().Be(TimeSpan.Parse("0"));
            response.TweetTweetId.Should().Be(1);
        }
Пример #4
0
        public void MapEFToBO()
        {
            var     mapper = new DALRetweetMapper();
            Retweet entity = new Retweet();

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

            BORetweet response = mapper.MapEFToBO(entity);

            response.Date.Should().Be(DateTime.Parse("1/1/1987 12:00:00 AM"));
            response.Id.Should().Be(1);
            response.RetwitterUserId.Should().Be(1);
            response.Time.Should().Be(TimeSpan.Parse("0"));
            response.TweetTweetId.Should().Be(1);
        }