Пример #1
0
        public void MapModelToEntity()
        {
            var mapper = new DALUserMapper();
            ApiUserServerRequestModel model = new ApiUserServerRequestModel();

            model.SetProperties("A", "A");
            User response = mapper.MapModelToEntity(1, model);

            response.Password.Should().Be("A");
            response.Username.Should().Be("A");
        }
Пример #2
0
        public void MapEntityToModel()
        {
            var  mapper = new DALUserMapper();
            User item   = new User();

            item.SetProperties(1, "A", "A");
            ApiUserServerResponseModel response = mapper.MapEntityToModel(item);

            response.Id.Should().Be(1);
            response.Password.Should().Be("A");
            response.Username.Should().Be("A");
        }
Пример #3
0
        public void MapEntityToModelList()
        {
            var  mapper = new DALUserMapper();
            User item   = new User();

            item.SetProperties(1, "A", "A");
            List <ApiUserServerResponseModel> response = mapper.MapEntityToModel(new List <User>()
            {
                { item }
            });

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