Пример #1
0
        public void MapEntityToModelList()
        {
            var mapper = new DALCustomerCommunicationMapper();
            CustomerCommunication item = new CustomerCommunication();

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

            response.Count.Should().Be(1);
        }
Пример #2
0
        public void MapEntityToModel()
        {
            var mapper = new DALCustomerCommunicationMapper();
            CustomerCommunication item = new CustomerCommunication();

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

            response.CustomerId.Should().Be(1);
            response.DateCreated.Should().Be(DateTime.Parse("1/1/1987 12:00:00 AM"));
            response.EmployeeId.Should().Be(1);
            response.Id.Should().Be(1);
            response.Notes.Should().Be("A");
        }
        public virtual CustomerCommunication MapModelToEntity(
            int id,
            ApiCustomerCommunicationServerRequestModel model
            )
        {
            CustomerCommunication item = new CustomerCommunication();

            item.SetProperties(
                id,
                model.CustomerId,
                model.DateCreated,
                model.EmployeeId,
                model.Notes);
            return(item);
        }