コード例 #1
0
        public void ErrorAlAgregarOrdenErronea()
        {
            ProcesoProductivoEmpleadosServicio proc = new ProcesoProductivoEmpleadosServicio(new List <Orden>()
            {
                new Orden((new List <Etapas>()
                {
                    new Etapas(new Empleado()
                    {
                        Nombre = "lucas", Dni = 32638916, Id = 1
                    }, 2, "")
                }),
                          new List <MateriasPrima>()
                {
                    new MateriasPrima()
                    {
                        Nombre = "Pintura", Id = 1, Cantidad = 30, Costo = 1000
                    }
                }, DateTime.Now)
            });
            List <String> listaErrores = new List <String>();

            foreach (Orden orden in proc.ListOrdenes)
            {
                foreach (var item in orden.listEtapas)
                {
                    var ex = Assert.Throws <ExcepcionesDeDominio>(
                        () => new Nombre(item.Nombre)).Message.ToString();
                }
            }
        }
コード例 #2
0
        public void SePuedeAgregarOrden()
        {
            ProcesoProductivoEmpleadosServicio ProcesoProductivo = new ProcesoProductivoEmpleadosServicio(new List <Orden>()
            {
                new Orden((new List <Etapas>()
                {
                    new Etapas(new Empleado()
                    {
                        Nombre = "lucas", Dni = 32638916, Id = 1
                    }, 20, "Preparacion")
                }),
                          new List <MateriasPrima>()
                {
                    new MateriasPrima()
                    {
                        Nombre = "Pintura", Id = 1, Cantidad = 30, Costo = 1000
                    }
                }, DateTime.Now)
            });


            bool opcion = ProcesoProductivo.SePuedeAgregarOrden();

            Assert.True(opcion == true);
        }
コード例 #3
0
        public void CalcularDuracionEnHorasProceso()
        {
            ProcesoProductivoEmpleadosServicio proc = new ProcesoProductivoEmpleadosServicio(
                new List <Orden>()
            {
                new Orden((new List <Etapas>()
                {
                    new Etapas(
                        new Empleado()
                    {
                        Nombre = "lucas", Dni = 32638916, Id = 1
                    }, 2, "Proceso 1")
                }),
                          new List <MateriasPrima>()
                {
                    new MateriasPrima()
                    {
                        Nombre = "Pintura", Id = 1, Cantidad = 30, Costo = 1000
                    }
                }, DateTime.Now)
            });

            decimal duracion = proc.CalcularDuracionProducto();

            Assert.True(2 == duracion);
        }
コード例 #4
0
 public TestProcesoProductivo()
 {
     ProcesoProductivoGeneral = new ProcesoProductivoEmpleadosServicio(new List <Orden>()
     {
         new Orden((new List <Etapas>()
         {
             new Etapas(new Empleado()
             {
                 Nombre = "lucas", Dni = 32638916, Id = 1
             }, 20, "Preparacion")
         }),
                   new List <MateriasPrima>()
         {
             new MateriasPrima()
             {
                 Nombre = "Pintura", Id = 1, Cantidad = 30, Costo = 1000
             }
         }, DateTime.Now)
     });
 }