Ejemplo n.º 1
0
        public virtual BOSchemaBPerson MapEFToBO(
            SchemaBPerson ef)
        {
            var bo = new BOSchemaBPerson();

            bo.SetProperties(
                ef.Id,
                ef.Name);
            return(bo);
        }
Ejemplo n.º 2
0
        public virtual SchemaBPerson MapBOToEF(
            BOSchemaBPerson bo)
        {
            SchemaBPerson efSchemaBPerson = new SchemaBPerson();

            efSchemaBPerson.SetProperties(
                bo.Id,
                bo.Name);
            return(efSchemaBPerson);
        }
Ejemplo n.º 3
0
        public void MapEFToBO()
        {
            var           mapper = new DALSchemaBPersonMapper();
            SchemaBPerson entity = new SchemaBPerson();

            entity.SetProperties(1, "A");

            BOSchemaBPerson response = mapper.MapEFToBO(entity);

            response.Id.Should().Be(1);
            response.Name.Should().Be("A");
        }
Ejemplo n.º 4
0
        public void MapBOToEF()
        {
            var mapper = new DALSchemaBPersonMapper();
            var bo     = new BOSchemaBPerson();

            bo.SetProperties(1, "A");

            SchemaBPerson response = mapper.MapBOToEF(bo);

            response.Id.Should().Be(1);
            response.Name.Should().Be("A");
        }
Ejemplo n.º 5
0
        public void MapEFToBOList()
        {
            var           mapper = new DALSchemaBPersonMapper();
            SchemaBPerson entity = new SchemaBPerson();

            entity.SetProperties(1, "A");

            List <BOSchemaBPerson> response = mapper.MapEFToBO(new List <SchemaBPerson>()
            {
                entity
            });

            response.Count.Should().Be(1);
        }
Ejemplo n.º 6
0
        public async void Get()
        {
            var mock   = new ServiceMockFacade <ISchemaBPersonRepository>();
            var record = new SchemaBPerson();

            mock.RepositoryMock.Setup(x => x.Get(It.IsAny <int>())).Returns(Task.FromResult(record));
            var service = new SchemaBPersonService(mock.LoggerMock.Object,
                                                   mock.RepositoryMock.Object,
                                                   mock.ModelValidatorMockFactory.SchemaBPersonModelValidatorMock.Object,
                                                   mock.BOLMapperMockFactory.BOLSchemaBPersonMapperMock,
                                                   mock.DALMapperMockFactory.DALSchemaBPersonMapperMock);

            ApiSchemaBPersonResponseModel response = await service.Get(default(int));

            response.Should().NotBeNull();
            mock.RepositoryMock.Verify(x => x.Get(It.IsAny <int>()));
        }