Example #1
0
        public void MapModelToBO()
        {
            var mapper = new BOLContactTypeMapper();
            ApiContactTypeRequestModel model = new ApiContactTypeRequestModel();

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

            response.ModifiedDate.Should().Be(DateTime.Parse("1/1/1987 12:00:00 AM"));
            response.Name.Should().Be("A");
        }
Example #2
0
        public void MapBOToModel()
        {
            var           mapper = new BOLContactTypeMapper();
            BOContactType bo     = new BOContactType();

            bo.SetProperties(1, DateTime.Parse("1/1/1987 12:00:00 AM"), "A");
            ApiContactTypeResponseModel response = mapper.MapBOToModel(bo);

            response.ContactTypeID.Should().Be(1);
            response.ModifiedDate.Should().Be(DateTime.Parse("1/1/1987 12:00:00 AM"));
            response.Name.Should().Be("A");
        }
Example #3
0
        public void MapBOToModelList()
        {
            var           mapper = new BOLContactTypeMapper();
            BOContactType bo     = new BOContactType();

            bo.SetProperties(1, DateTime.Parse("1/1/1987 12:00:00 AM"), "A");
            List <ApiContactTypeResponseModel> response = mapper.MapBOToModel(new List <BOContactType>()
            {
                { bo }
            });

            response.Count.Should().Be(1);
        }
Example #4
0
        public void MapEFToBO()
        {
            var         mapper = new DALContactTypeMapper();
            ContactType entity = new ContactType();

            entity.SetProperties(1, DateTime.Parse("1/1/1987 12:00:00 AM"), "A");

            BOContactType response = mapper.MapEFToBO(entity);

            response.ContactTypeID.Should().Be(1);
            response.ModifiedDate.Should().Be(DateTime.Parse("1/1/1987 12:00:00 AM"));
            response.Name.Should().Be("A");
        }