Esempio n. 1
0
        public virtual Following MapBOToEF(
            BOFollowing bo)
        {
            Following efFollowing = new Following();

            efFollowing.SetProperties(
                bo.DateFollowed,
                bo.Muted,
                bo.UserId);
            return(efFollowing);
        }
Esempio n. 2
0
        public void MapEntityToModel()
        {
            var       mapper = new DALFollowingMapper();
            Following item   = new Following();

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

            response.DateFollowed.Should().Be(DateTime.Parse("1/1/1987 12:00:00 AM"));
            response.Muted.Should().Be("A");
            response.UserId.Should().Be(1);
        }
Esempio n. 3
0
        public virtual Following MapModelToEntity(
            int userId,
            ApiFollowingServerRequestModel model
            )
        {
            Following item = new Following();

            item.SetProperties(
                userId,
                model.DateFollowed,
                model.Muted);
            return(item);
        }
Esempio n. 4
0
        public void MapEFToBO()
        {
            var       mapper = new DALFollowingMapper();
            Following entity = new Following();

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

            BOFollowing response = mapper.MapEFToBO(entity);

            response.DateFollowed.Should().Be(DateTime.Parse("1/1/1987 12:00:00 AM"));
            response.Muted.Should().Be("A");
            response.UserId.Should().Be("A");
        }
Esempio n. 5
0
        public void MapEntityToModelList()
        {
            var       mapper = new DALFollowingMapper();
            Following item   = new Following();

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

            response.Count.Should().Be(1);
        }
Esempio n. 6
0
        public void MapEFToBOList()
        {
            var       mapper = new DALFollowingMapper();
            Following entity = new Following();

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

            List <BOFollowing> response = mapper.MapEFToBO(new List <Following>()
            {
                entity
            });

            response.Count.Should().Be(1);
        }