Exemple #1
0
        private Direccion getDireccion(GremioRequest gremioRequest)
        {
            var direccionRequest = gremioRequest.direccionRequest;
            var departamento     = getDepartamento(direccionRequest);
            var municipio        = getMunicipio(direccionRequest);

            return(new Direccion(departamento, municipio, direccionRequest.descripcion));
        }
Exemple #2
0
        public void isValidPutDireccion_dataInvalid_returnFalse(RTNRequest rtnRequest, DireccionRequest direccionRequest)
        {
            var gremio = new GremioRequest();

            gremio.rtnRequest       = rtnRequest;
            gremio.direccionRequest = direccionRequest;

            var respuesta = gremio.isValidPutDireccion();

            Assert.IsFalse(respuesta);
        }
Exemple #3
0
        public void isValidPutRepresentante_dataValid_returnTrue()
        {
            var gremio = new GremioRequest();

            gremio.rtnRequest = getValidRTN();
            gremio.representanteLegalRequest = getValidRepresentanteLegal();

            var respuesta = gremio.isValidPutRepresentante();

            Assert.IsTrue(respuesta);
        }
Exemple #4
0
        public void isValidPutRepresentante_dataInvalid_returnFalse(RTNRequest rtn, RepresentanteLegalRequest representante)
        {
            var gremio = new GremioRequest();

            gremio.rtnRequest = rtn;
            gremio.representanteLegalRequest = representante;

            var respuesta = gremio.isValidPutRepresentante();

            Assert.IsFalse(respuesta);
        }
Exemple #5
0
        public Gremio getGremioForPost(GremioRequest gremioRequest)
        {
            var representanteLegal = getRepresentanteLegal(gremioRequest);
            var rtn       = getRTN(gremioRequest);
            var direccion = getDireccion(gremioRequest);
            var nombre    = gremioRequest.nombre;
            var gremio    = new Gremio(rtn, representanteLegal, direccion, nombre);

            gremio.Auditoria = getAuditoria(gremioRequest.auditoriaRequest);
            return(gremio);
        }
Exemple #6
0
        public void isValidRequest_dataInvalid_returnFalse(RepresentanteLegalRequest representante, RTNRequest rtn, DireccionRequest direccion, string nombre)
        {
            var gremio = new GremioRequest();

            gremio.representanteLegalRequest = representante;
            gremio.rtnRequest       = rtn;
            gremio.direccionRequest = direccion;
            gremio.nombre           = nombre;

            var respuesta = gremio.isValidPost();

            Assert.IsFalse(respuesta);
        }
Exemple #7
0
        private RepresentanteLegal getRepresentanteLegal(GremioRequest gremioRequest)
        {
            var rtnRequest             = gremioRequest.rtnRequest;
            var representanteRequest   = gremioRequest.representanteLegalRequest;
            var identidadRepresentante = representanteRequest.identidadRequest;
            var identidad = new Identidad(identidadRepresentante.identidad);



            var representanteLegal = new RepresentanteLegal(identidad, representanteRequest.nombre);

            return(representanteLegal);
        }
Exemple #8
0
        private static IEnumerable <GremioRequest> getGremiosRequests()
        {
            var representante1 = getRepresentanteLegal("0801198512396", "representante");
            var direccion1     = getDireccion("01", "01", "01", "Barrio Abajo");
            var gremio1        = new GremioRequest()
            {
                direccionRequest          = direccion1,
                nombre                    = "Camara",
                representanteLegalRequest = representante1,
                rtnRequest                = new RTNRequest()
                {
                    RTN = "08011985123960"
                },
                auditoriaRequest = new AuditoriaRequest()
                {
                    fechaCreo       = DateTime.Now.Date,
                    fechaModifico   = DateTime.Now.Date,
                    usuarioCreo     = "",
                    usuarioModifico = ""
                }
            };

            var representante2 = getRepresentanteLegal("0801198511111", "representante");
            var direccion2     = getDireccion("02", "02", "02", "Barrio Abajo");
            var gremio2        = new GremioRequest()
            {
                direccionRequest          = direccion2,
                nombre                    = "Maquiladores",
                representanteLegalRequest = representante2,
                rtnRequest                = new RTNRequest()
                {
                    RTN = "08011985123960"
                },
                auditoriaRequest = new AuditoriaRequest()
                {
                    fechaCreo       = DateTime.Now.Date,
                    fechaModifico   = DateTime.Now.Date,
                    usuarioCreo     = "",
                    usuarioModifico = ""
                }
            };

            return(new List <GremioRequest>()
            {
                gremio1, gremio2
            });
        }
Exemple #9
0
        public void isValidRequest_dataValid_returnTrue()
        {
            var representante = getValidRepresentanteLegal();
            var rtn           = getValidRTN();
            var direccion     = getValidDireccion();


            var gremio = new GremioRequest()
            {
                direccionRequest          = direccion,
                nombre                    = "Camara",
                representanteLegalRequest = representante,
                rtnRequest                = rtn
            };

            var respuesta = gremio.isValidPost();


            Assert.IsTrue(respuesta);
        }
        public void isValidPost_invalidData_returnFalse(RTNRequest rtn, GremioRequest gremio,
                                                        IEnumerable <SucursalRequest> sucursales,
                                                        IEnumerable <ActividadEconomicaRequest> actividades, string nombre, string file, DateTime fechaIngreso)
        {
            var empresa = new EmpresaRequest()
            {
                actividadEconomicaRequests = actividades,
                contentFile      = file,
                empleadosTotales = 0,
                gremioRequest    = gremio,
                programaPiloto   = true,
                rtnRequest       = rtn,
                sucursalRequests = sucursales,
                nombre           = nombre,
                fechaIngreso     = fechaIngreso
            };

            var respuesta = empresa.isValidPost();

            Assert.IsFalse(respuesta);
        }
Exemple #11
0
        private static Gremio convertToGremio(GremioRequest request)
        {
            var rtn                 = request.rtnRequest;
            var representante       = request.representanteLegalRequest;
            var direccion           = request.direccionRequest;
            var rtnGremio           = new RTN(rtn.RTN);
            var auditoria           = request.auditoriaRequest;
            var representanteGremio = new RepresentanteLegal(new Identidad(representante.identidadRequest.identidad),
                                                             representante.nombre);

            var municipioGremio = new Municipio()
            {
                DepartamentoId = direccion.departamentoRequest.idDepartamento,
                Id             = direccion.municipioRequest.idMunicipio,
                Nombre         = direccion.municipioRequest.nombre
            };


            var departamentoGremio = new Departamento()
            {
                Id         = direccion.departamentoRequest.idDepartamento,
                Municipios = new List <Municipio>()
                {
                    municipioGremio
                },
                Nombre = direccion.departamentoRequest.nombre
            };
            var direccionGremio = new Direccion(departamentoGremio, municipioGremio, direccion.descripcion);

            direccionGremio.Id = direccion.IdGuid;

            var auditoriaGremio = new Auditoria(auditoria.usuarioCreo, auditoria.fechaCreo, auditoria.usuarioModifico,
                                                auditoria.fechaModifico);

            var gremio = new Gremio(rtnGremio, representanteGremio, direccionGremio, request.nombre);

            gremio.Auditoria = auditoriaGremio;
            return(gremio);
        }
Exemple #12
0
        private static GremioRequest getGremioRequest()
        {
            var representante1 = getRepresentanteLegal("0801198512396", "representante");
            var direccion1     = getDireccion("01", "01", "01", "Barrio Abajo");
            var gremio1        = new GremioRequest()
            {
                direccionRequest          = direccion1,
                nombre                    = "Camara",
                representanteLegalRequest = representante1,
                rtnRequest                = new RTNRequest()
                {
                    RTN = "08011985123960"
                },
                auditoriaRequest = new AuditoriaRequest()
                {
                    fechaCreo       = DateTime.Now.Date,
                    fechaModifico   = DateTime.Now.Date,
                    usuarioCreo     = "",
                    usuarioModifico = ""
                }
            };

            return(gremio1);
        }
Exemple #13
0
        private GremioRequest convertToGremioRequest(Gremio gremio)
        {
            var direccion     = gremio.Direccion;
            var departamento  = direccion.Departamento;
            var municipio     = direccion.Municipio;
            var auditoria     = gremio.Auditoria;
            var rtn           = gremio.Id;
            var representante = gremio.RepresentanteLegal;
            var nombreGremio  = gremio.Nombre;


            var representanteRequest = new RepresentanteLegalRequest()
            {
                identidadRequest = new IdentidadRequest()
                {
                    identidad = representante.Id.identidad
                },
                nombre = representante.Nombre
            };

            var rtnRequestGremio = new RTNRequest()
            {
                RTN = rtn.Rtn
            };
            var departamentoRequestGremio = new DepartamentoRequest()
            {
                idDepartamento = departamento.Id,
                nombre         = departamento.Nombre
            };

            var municipioRequestGremio = new MunicipioRequest()
            {
                idDepartamento = municipio.DepartamentoId,
                idMunicipio    = municipio.Id,
                nombre         = municipio.Nombre
            };
            var direccionRequestGremio = new DireccionRequest()
            {
                departamentoRequest = departamentoRequestGremio,
                municipioRequest    = municipioRequestGremio,
                descripcion         = direccion.ReferenciaDireccion,
                IdGuid = direccion.Id
            };

            var auditoriaRequest = new AuditoriaRequest()
            {
                fechaCreo       = auditoria.FechaCreacion,
                fechaModifico   = auditoria.FechaActualizacion,
                usuarioCreo     = auditoria.CreadoPor,
                usuarioModifico = auditoria.ActualizadoPor
            };
            var gremioRequest = new GremioRequest()
            {
                direccionRequest          = direccionRequestGremio,
                rtnRequest                = rtnRequestGremio,
                representanteLegalRequest = representanteRequest,
                nombre = nombreGremio
            };

            gremioRequest.auditoriaRequest = auditoriaRequest;

            return(gremioRequest);
        }
Exemple #14
0
        private Gremio getGremio(GremioRequest request)
        {
            var gremioMap = new GremioMap();

            return(gremioMap.getGremioForPost(request));
        }
Exemple #15
0
        private RTN getRTN(GremioRequest gremioRequest)
        {
            var rtn = new RTN(gremioRequest.rtnRequest.RTN);

            return(rtn);
        }