Beispiel #1
0
        public void MapBOToModelList()
        {
            var     mapper = new BOLTweetMapper();
            BOTweet bo     = new BOTweet();

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

            response.Count.Should().Be(1);
        }
Beispiel #2
0
        public void MapModelToBO()
        {
            var mapper = new BOLTweetMapper();
            ApiTweetRequestModel model = new ApiTweetRequestModel();

            model.SetProperties("A", DateTime.Parse("1/1/1987 12:00:00 AM"), 1, TimeSpan.Parse("0"), 1);
            BOTweet response = mapper.MapModelToBO(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("0"));
            response.UserUserId.Should().Be(1);
        }
Beispiel #3
0
        public void MapBOToModel()
        {
            var     mapper = new BOLTweetMapper();
            BOTweet bo     = new BOTweet();

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

            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("0"));
            response.TweetId.Should().Be(1);
            response.UserUserId.Should().Be(1);
        }
Beispiel #4
0
        public void MapEFToBO()
        {
            var   mapper = new DALTweetMapper();
            Tweet entity = new Tweet();

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

            BOTweet response = mapper.MapEFToBO(entity);

            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("0"));
            response.TweetId.Should().Be(1);
            response.UserUserId.Should().Be(1);
        }