Ejemplo n.º 1
0
        public void MapEntityToModelList()
        {
            var   mapper = new DALAdminMapper();
            Admin item   = new Admin();

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

            response.Count.Should().Be(1);
        }
Ejemplo n.º 2
0
        public void MapModelToEntity()
        {
            var mapper = new DALAdminMapper();
            ApiAdminServerRequestModel model = new ApiAdminServerRequestModel();

            model.SetProperties(DateTime.Parse("1/1/1987 12:00:00 AM"), "A", "A", "A", "A", 1);
            Admin response = mapper.MapModelToEntity(1, model);

            response.Birthday.Should().Be(DateTime.Parse("1/1/1987 12:00:00 AM"));
            response.Email.Should().Be("A");
            response.FirstName.Should().Be("A");
            response.LastName.Should().Be("A");
            response.Phone.Should().Be("A");
            response.UserId.Should().Be(1);
        }
Ejemplo n.º 3
0
        public void MapEntityToModel()
        {
            var   mapper = new DALAdminMapper();
            Admin item   = new Admin();

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

            response.Birthday.Should().Be(DateTime.Parse("1/1/1987 12:00:00 AM"));
            response.Email.Should().Be("A");
            response.FirstName.Should().Be("A");
            response.Id.Should().Be(1);
            response.LastName.Should().Be("A");
            response.Phone.Should().Be("A");
            response.UserId.Should().Be(1);
        }