public void TestCocineroNuloGetMailNoFalla()
        {
            string nombreDelPlato = "Pollo a la parrilla";

            DLL_Restaurante.Plato unPlato = new  DLL_Restaurante.Plato(nombreDelPlato, 5);
            Assert.IsNotNull(unPlato.GetMailDelCocinero());
        }
        public void TestOpinionNulaParaPlato()
        {
            double puntajePromedioEsperado = 0;

            DLL_Restaurante.Plato unPlato = new DLL_Restaurante.Plato("Rana asada", 1);

            Assert.AreEqual(unPlato.GetOpinionPromedio(), puntajePromedioEsperado);
        }
Example #3
0
        public void TestCartaAgregarPlatoYObtenerPrecioPromedio()
        {
            DLL_Restaurante.Carta laCarta = new DLL_Restaurante.Carta();
            DLL_Restaurante.Plato unPlato = new DLL_Restaurante.Plato("Fritas con chedar y panceta", 3);
            laCarta.AgregarPlato(unPlato);

            Assert.AreEqual(unPlato.GetPrecio(), laCarta.GetPrecioPromedio());
        }
        public void TestPrecioSinIngredientes()
        {
            double precioEsperado         = DLL_Restaurante.Plato.PRECIO_BASE_PLATO;
            int    cantidadDeIngredientes = 0;

            DLL_Restaurante.Plato unPlato = new DLL_Restaurante.Plato("Agua", cantidadDeIngredientes);

            Assert.AreEqual(unPlato.GetPrecio(), precioEsperado);
        }
        public void TestOpinionPromedioDePlato()
        {
            double puntajePromedioEsperado = (double)(5 + 4 + 4) / 3;

            DLL_Restaurante.Plato unPlato = new DLL_Restaurante.Plato("Lomo a la mostaza", 3);

            unPlato.AgregarOpinion(5);
            unPlato.AgregarOpinion(4);
            unPlato.AgregarOpinion(4);

            Assert.AreEqual(unPlato.GetOpinionPromedio(), puntajePromedioEsperado);
        }
        public void TestPrecioConPocosIngredientes()
        {
            double precioEsperado         = 0;
            int    cantidadDeIngredientes = 1;

            DLL_Restaurante.Plato unPlato = new DLL_Restaurante.Plato("Omelette", cantidadDeIngredientes);

            precioEsperado = DLL_Restaurante.Plato.PRECIO_BASE_PLATO +
                             DLL_Restaurante.Plato.PRECIO_POCOS_INGREDIENTES * cantidadDeIngredientes;

            Assert.AreEqual(unPlato.GetPrecio(), precioEsperado);
        }
        public void TestPrecioConVariosIngredientes()
        {
            double precioEsperado         = 0;
            int    cantidadDeIngredientes = 4;

            DLL_Restaurante.Plato unPlato = new DLL_Restaurante.Plato("Hamburguesa completa", cantidadDeIngredientes);

            precioEsperado = DLL_Restaurante.Plato.PRECIO_BASE_PLATO +
                             DLL_Restaurante.Plato.PRECIO_VARIOS_INGREDIENTES * cantidadDeIngredientes;

            Assert.AreEqual(unPlato.GetPrecio(), precioEsperado);
        }
        public void TestPlatoImprimite()
        {
            string nombreDelPlato  = "Pollo a la parrilla";
            string mailDelCocinero = "*****@*****.**";

            DLL_Restaurante.Plato unPlato = new  DLL_Restaurante.Plato(nombreDelPlato, 5);
            unPlato.Cocinero = new DLL_Restaurante.Cocinero("Jorge", "Bustos", mailDelCocinero);
            unPlato.AgregarOpinion(5);
            unPlato.AgregarOpinion(3);

            Assert.AreEqual(unPlato.Imprimite(), nombreDelPlato + " (4 puntos) - " + mailDelCocinero);
        }
Example #9
0
        public void TestCartaRemoverPlatoYPromedioDePrecioNulo()
        {
            DLL_Restaurante.Carta laCarta = new DLL_Restaurante.Carta();
            DLL_Restaurante.Plato unPlato = new DLL_Restaurante.Plato("Fritas con chedar y panceta", 3);
            laCarta.AgregarPlato(unPlato);

            double precioPromedio = laCarta.GetPrecioPromedio();

            laCarta.RemoverPlato(unPlato);

            Assert.AreNotEqual(precioPromedio, laCarta.GetPrecioPromedio());
            Assert.AreEqual(laCarta.GetPrecioPromedio(), 0);
        }
Example #10
0
        public void TestCartaGetPlatoMejorOpinion()
        {
            DLL_Restaurante.Plato mejorPlato = new DLL_Restaurante.Plato("Risotto de hongos y finas hiervas", 6);
            mejorPlato.AgregarOpinion(5);
            mejorPlato.AgregarOpinion(4);
            mejorPlato.AgregarOpinion(5);
            mejorPlato.AgregarOpinion(5);
            DLL_Restaurante.Plato otroPlato = new DLL_Restaurante.Plato("Churrasquito premium con rusa", 5);
            otroPlato.AgregarOpinion(2);
            otroPlato.AgregarOpinion(5);
            otroPlato.AgregarOpinion(4);
            DLL_Restaurante.Carta laCarta = new DLL_Restaurante.Carta();
            laCarta.AgregarPlato(mejorPlato);
            laCarta.AgregarPlato(otroPlato);

            Assert.AreSame(mejorPlato, laCarta.GetPlatoMejorOpinion());
        }
        /// <summary>
        /// Este método genera objetos de tipo <c>Plato</c> a partir de una lista de nombres y prueba su carga satisfactoria.
        /// </summary>
        /// <remarks>
        /// Por cada nombre instancia dos platos, cada uno con un constructor distinto. Luego compara que ambos tengan el mismo nombre que se les cargó.
        /// </remarks>
        public void TestNombresDePlatos()
        {
            List <string> nombreDePlatos = new List <string>();

            nombreDePlatos.Add("Milanesas con papas fritas");
            nombreDePlatos.Add("Pollo a la parrilla");
            nombreDePlatos.Add("Ensalada de rúcula, tomate y queso");
            nombreDePlatos.Add("Hamburguesa");

            DLL_Restaurante.Plato unPlato, mismoPlato;

            for (int i = 0; i < nombreDePlatos.Count; i++)
            {
                unPlato           = new DLL_Restaurante.Plato(nombreDePlatos[i], 0);
                mismoPlato        = new DLL_Restaurante.Plato();
                mismoPlato.Nombre = nombreDePlatos[i];

                Assert.AreEqual(unPlato.Nombre, mismoPlato.Nombre);
                Assert.AreEqual(unPlato.Nombre, nombreDePlatos[i]);
            }
        }