示例#1
0
        public void EmfSpool_AnalizeEmf_AnalizaFicherosSpoolEMF()
        {
            // Struct para almacenar detalles de impresión (el contenido para el test es indiferente
            STRUCT_PRINT_JOB PrintJob = new STRUCT_PRINT_JOB();
            EmfSpool         MiEmfSpool;
            // Path con los ficheros de Spool
            //string Path = @"D:\SpoolImpresora\Test\EMF";
            //string Path = @"D:\SpoolImpresora\Test\PlotterEMF";
            //string Path = @"D:\SpoolImpresora\Test";


            //string Path = @"D:\SpoolImpresora\Test\PlotterEMF";
            //string Path = @"D:\SpoolImpresora\Test\PlotterEMF\2015-07-23";
            //string Path = @"D:\SpoolImpresora\Test\PlotterEMF\2016-03-30";
            //string Path = @"D:\SpoolImpresora\Test\PlotterEMF\2016-04-01";
            //string Path = @"D:\SpoolImpresora\Test\PlotterEMF\2016-04-07";
            //string Path = @"D:\SpoolImpresora\Test\PlotterEMF\2016-04-27_2016-04-29";
            //string Path = @"D:\SpoolImpresora\Test\PlotterEMF\2016-05-05";
            //string Path = @"D:\SpoolImpresora\Test\PlotterEMF\2016-04-18_2016-04-29";


            //string Path = @"D:\TestMonitorImpresion\EMF";
            string Path = @"D:\TestMonitorImpresion\PlotterEMF";



            //string Path = @"D:\SpoolImpresora\Test\PlotterEMF\2016-04-12";
            //string Path = @"D:\SpoolImpresora\Test\PlotterEMF\2016-04-15";
            //string Path = @"D:\SpoolImpresora";


            // Directorio donde se encuentran los ficheros de Spool
            DirectoryInfo Directorio = new DirectoryInfo(Path);

            foreach (var Archivo in Directorio.GetFiles("*.SPL"))
            {
                /// Inicialización (Arrange)
                /// - Inicializamos la clase para analizar un fichero de Spool
                MiEmfSpool = new EmfSpool(Path + @"\" + Archivo);

                /// Ejecución (Act)
                /// - Ejecutamos el método
                PrintJob = new STRUCT_PRINT_JOB();
                MiEmfSpool.Analize(ref PrintJob);
                AnalizeJobId.LogPrintJob(ref PrintJob);

                /// Comprobación (Assert)
                /// - Se comprueba que el fichero de Spool tiene contenido (no está vacio)
                /// - Comprobamos que se ha analizado sin errores el fichero de Spool completo
                Assert.IsTrue(MiEmfSpool.AnalisisCompletado && (MiEmfSpool.SizeFile > 0));
            }
        }
示例#2
0
        public void JPLSpool_AnalizePJLPClXl_AnalizaContenidoSpoolPJLPClXl()
        {
            // Struct para almacenar detalles de impresión (el contenido para el test es indiferente
            STRUCT_PRINT_JOB PrintJob; // = new STRUCT_PRINT_JOB();
            JPLSpool         MiJPLSpool;
            //string Path = @"D:\SpoolImpresora\Test\JPL-PCLXL";
            string Path = @"D:\TestMonitorImpresion\JPL-PCLXL";
            //string Path = @"D:\TestMonitorImpresion";


            //string Path = @"D:\SpoolImpresora\Test\PlotterJPLPCLXL";

            // ************** Test con 231 trabajos de impresión pasado correctamente. 8 minutos y 54 segundos ******************
            //string Path = @"D:\SpoolImpresora\Test\JPL-PCLXL\HP5500";
            // *****************************************************************************************

            //string Path = @"D:\SpoolImpresora\Test\JPL-PCLXL\HP5500\01_LOTE";
            //string Path = @"D:\SpoolImpresora\Test";



            // Directorio donde se encuentran los ficheros de Spool
            DirectoryInfo Directorio = new DirectoryInfo(Path);

            foreach (var Archivo in Directorio.GetFiles("*.SPL"))
            {
                //Console.WriteLine(archivo.Name);
                /// Inicialización (Arrange)
                MiJPLSpool = new JPLSpool(Path + @"\" + Archivo);

                /// Ejecución (Act)
                PrintJob = new STRUCT_PRINT_JOB();
                MiJPLSpool.Analize(ref PrintJob);
                AnalizeJobId.LogPrintJob(ref PrintJob);


                /// Comprobación (Assert)
                if (MiJPLSpool.ContenidoPCLXL)
                {
                    Assert.IsTrue(MiJPLSpool.AnalisisCompletado && MiJPLSpool.AnalisisPCLXLCompletado && (MiJPLSpool.SizeFile > 0));
                }
                else
                {
                    Assert.IsTrue(MiJPLSpool.AnalisisCompletado && (MiJPLSpool.SizeFile > 0));
                }
            }
        }