public void GetCollecionModulosSeccionServicios()
        {
            var boletin = new Boletin(inputBoletinText);

            IEnumerable<string> coleccionModulos = boletin.GetModulosSeccion(BoletinSeccion.Servicios);

            Assert.AreEqual(2, coleccionModulos.Count());
        }
        public void GetCollecionModulosSeccionDictamenesDeEvaluacion()
        {
            var boletin = new Boletin(inputBoletinText);

            IEnumerable<string> coleccionModulos = boletin.GetModulosSeccion(BoletinSeccion.Dictamenes);

            Assert.AreEqual(1, coleccionModulos.Count());
        }
        public void GetCollecionModulosSeccionAdjudicaciones()
        {
            var boletin = new Boletin(inputBoletinText);

            IEnumerable<string> coleccionModulos = boletin.GetModulosSeccion(BoletinSeccion.Adjudicaciones);

            Assert.AreEqual(coleccionModulos.Count(), 4);
            Assert.IsTrue(coleccionModulos.ElementAt(0).Contains("BANCO DE LA NACION ARGENTINA"));
            Assert.IsTrue(coleccionModulos.ElementAt(2).Contains("BLOQUE2"));
        }
        public void GetDesdeCopeteSeccionAdjudicaciones_NoHayCopeteDeAdjudicaciones()
        {
            this.inputBoletinText = this.inputBoletinText.Replace("Adjudicaciones", @"#I4284951I# % 23 % #N157178/11N#\nAdjudicaciones");

            var boletin = new Boletin(inputBoletinText);

            var desdeAdjudicaciones = "";
            if (boletin.TieneSeccion(BoletinSeccion.Adjudicaciones))
            {
                desdeAdjudicaciones = boletin.GetDesdeCopete(BoletinSeccion.Adjudicaciones);
            }

            Assert.IsEmpty(desdeAdjudicaciones);
        }
        public void GetDesdeCopeteSeccionAdjudicaciones()
        {
            var boletin = new Boletin(inputBoletinTextPartial);

            var desdeAdjudicaciones = "";
            if (boletin.TieneSeccion(BoletinSeccion.Adjudicaciones))
            {
                desdeAdjudicaciones = boletin.GetDesdeCopete(BoletinSeccion.Adjudicaciones);
            }

            Assert.AreEqual(desdeAdjudicaciones, @"
            BANCO DE LA NACION ARGENTINA
            AREA COMPRAS Y CONTRATACIONES");
        }
Beispiel #6
0
        static void Main(string[] args)
        {
            BoletinFileName boletinFileName = new BoletinFileName(args[0]);

            Boletin boletin;
            //using (var streamReader = new StreamReader(@"C:\Documents and Settings\Administrador\Mis documentos\Visual Studio 2010\Projects\boletin\material\BO20111201-3.txt"))
            using (var streamReader = new StreamReader(boletinFileName.FilePath))
            {
                boletin = new Boletin(streamReader.ReadToEnd());
            }

            AdjudicadorBuilder adjudicadorBuilder = new AdjudicadorBuilder(new ExtractorAdjudicacion());
            AdjudicacionRepository adjudicacionRepository = new AdjudicacionRepository();

            var modulos = boletin.GetModulosSeccion(BoletinSeccion.Adjudicaciones);
            foreach(var modulo in modulos)
            {
                Adjudicacion adjudicacion = adjudicadorBuilder.Build(modulo);
                adjudicacion.FechaBoletin = boletinFileName.GetDate();
                adjudicacionRepository.Save(adjudicacion);
            }
        }
        public void GetDesdeCopeteSeccionDictamenesDeEvaluacion()
        {
            var boletin = new Boletin(inputBoletinText);

            var desdeDictamenesDeEvaluacion = "";
            if (boletin.TieneSeccion(BoletinSeccion.Dictamenes))
            {
                desdeDictamenesDeEvaluacion = boletin.GetDesdeCopete(BoletinSeccion.Dictamenes);
            }

            Assert.AreEqual(desdeDictamenesDeEvaluacion, @"
            BANCO DE LA NACION ARGENTINA
            BANCO PIRULO
            % 19 % #F4285852F#
            Locaciones
            INMUEBLES (LOC)
            #I4286379I# % 19 % #N159046/11N#
            AFIP");
        }
        public void TieneSeccionServicios()
        {
            var boletin = new Boletin(inputBoletinText);

            bool tieneSeccionServicios= boletin.TieneSeccion(BoletinSeccion.Servicios);

            Assert.AreEqual(tieneSeccionServicios, true);
        }
        public void TieneSeccionLocaciones()
        {
            var boletin = new Boletin(inputBoletinText);

            bool tieneSeccionLocaciones = boletin.TieneSeccion(BoletinSeccion.Locaciones.Inmuebles);

            Assert.AreEqual(tieneSeccionLocaciones, true);
        }
        public void TieneSeccionDictamenesDeEvaluacion()
        {
            var boletin = new Boletin(inputBoletinText);

            bool tieneSeccionDictamenesDeEvaluacion = boletin.TieneSeccion(BoletinSeccion.Dictamenes);

            Assert.AreEqual(tieneSeccionDictamenesDeEvaluacion, true);
        }
        public void NoTieneSeccionAdjudicaciones()
        {
            this.inputBoletinText = this.inputBoletinText.Replace("Adjudicaciones", "Preadjudicaciones");
            var boletin = new Boletin(inputBoletinText);

            bool tieneSeccionAdjudicaciones = boletin.TieneSeccion(BoletinSeccion.Adjudicaciones);

            Assert.AreEqual(tieneSeccionAdjudicaciones, false);
        }
        public void GetSeccionServicios()
        {
            var boletin = new Boletin(inputBoletinText);

            var seccionServicios = "";
            if (boletin.TieneSeccion(BoletinSeccion.Servicios))
            {
                seccionServicios = boletin.GetSeccion(BoletinSeccion.Servicios);
            }

            Assert.AreEqual(@"
            BLOQUE1
            % 23 % #F4285033F#
            #I4285622I# % 23 % #N158007/11N#
            BLOQUE2
            ", seccionServicios);
        }
        public void GetSeccionDictamenesDeEvaluacion()
        {
            var boletin = new Boletin(inputBoletinText);

            var seccionDictamenesDeEvaluacion = "";
            if (boletin.TieneSeccion(BoletinSeccion.Dictamenes))
            {
                seccionDictamenesDeEvaluacion = boletin.GetSeccion(BoletinSeccion.Dictamenes);
            }

            Assert.AreEqual(@"
            BANCO DE LA NACION ARGENTINA
            BANCO PIRULO
            ", seccionDictamenesDeEvaluacion);
        }
        public void GetSeccionAdjudicaciones()
        {
            var boletin = new Boletin(inputBoletinText);

            var seccionAdjudicaciones = "";
            if (boletin.TieneSeccion(BoletinSeccion.Adjudicaciones))
            {
                seccionAdjudicaciones = boletin.GetSeccion(BoletinSeccion.Adjudicaciones);
            }

            Assert.AreEqual(seccionAdjudicaciones, @"
            BANCO DE LA NACION ARGENTINA
            AREA COMPRAS Y CONTRATACIONES
            % 23 % #F4285033F#
            #I4285622I# % 23 % #N158007/11N#
            BLOQUE1
            % 23 % #F4285033F#
            #I4285622I# % 23 % #N158007/11N#
            BLOQUE2
            % 23 % #F4285033F#
            #I4285622I# % 23 % #N158007/11N#
            BLOQUE3
            ");
        }
        public void GetProximoCopeteSeccion()
        {
            var boletin = new Boletin(inputBoletinText);

            var proximoCopete = boletin.GetProximoCopete(inputBoletinText);

            Assert.AreEqual(proximoCopete, @"% 23 % #F4281795F#
            Servicios Tres Palabras
            Audiovisuales
            #I4284951I# % 23 % #N157178/11N#");
        }