Beispiel #1
0
        public void MapEntityToModelList()
        {
            var      mapper = new DALEmployeeMapper();
            Employee item   = new Employee();

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

            response.Count.Should().Be(1);
        }
Beispiel #2
0
        public void MapModelToEntity()
        {
            var mapper = new DALEmployeeMapper();
            ApiEmployeeServerRequestModel model = new ApiEmployeeServerRequestModel();

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

            response.FirstName.Should().Be("A");
            response.IsSalesPerson.Should().Be(true);
            response.IsShipper.Should().Be(true);
            response.LastName.Should().Be("A");
        }
Beispiel #3
0
        public void MapEntityToModel()
        {
            var      mapper = new DALEmployeeMapper();
            Employee item   = new Employee();

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

            response.FirstName.Should().Be("A");
            response.Id.Should().Be(1);
            response.IsSalesPerson.Should().Be(true);
            response.IsShipper.Should().Be(true);
            response.LastName.Should().Be("A");
        }