コード例 #1
0
        public void MapEntityToModelList()
        {
            var    mapper = new DALFamilyMapper();
            Family item   = new Family();

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

            response.Count.Should().Be(1);
        }
コード例 #2
0
        public void MapModelToEntity()
        {
            var mapper = new DALFamilyMapper();
            ApiFamilyServerRequestModel model = new ApiFamilyServerRequestModel();

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

            response.Notes.Should().Be("A");
            response.PrimaryContactEmail.Should().Be("A");
            response.PrimaryContactFirstName.Should().Be("A");
            response.PrimaryContactLastName.Should().Be("A");
            response.PrimaryContactPhone.Should().Be("A");
        }
コード例 #3
0
        public void MapEntityToModel()
        {
            var    mapper = new DALFamilyMapper();
            Family item   = new Family();

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

            response.Id.Should().Be(1);
            response.Notes.Should().Be("A");
            response.PrimaryContactEmail.Should().Be("A");
            response.PrimaryContactFirstName.Should().Be("A");
            response.PrimaryContactLastName.Should().Be("A");
            response.PrimaryContactPhone.Should().Be("A");
        }