예제 #1
0
        public void ConstructorPelicula()
        {
            var p1 = new Pelicula.Pelicula();
            var p2 = new Pelicula.Pelicula("La La Land", 2016);

            Assert.NotNull(p1);
            Assert.NotNull(p2);
        }
예제 #2
0
        public void GetSetPelicula()
        {
            var p1 = new Pelicula.Pelicula();

            p1.SetTitulo("La La Land");
            p1.SetAño(2016);

            Assert.Equal("La La Land", p1.GetTitulo());
            Assert.Equal(2016, p1.GetAño());
        }
예제 #3
0
        public void ImprimePelicula()
        {
            using (StringWriter s = new StringWriter())
            {
                Console.SetOut(s);
                var p2 = new Pelicula.Pelicula("La La Land", 2016);
                p2.Imprime();

                var result = s.ToString().Trim();
                Assert.Equal("La La Land (2016)", result);
            }
        }
예제 #4
0
        public void ImprimeActores()
        {
            Pelicula.Pelicula p1 = new Pelicula.Pelicula("La La Land", 2016);
            p1.AgregaActor(new Actor("Ryan Gosling", 1980));
            p1.AgregaActor(new Actor("Emma Stone", 1988));



            using (StringWriter s = new StringWriter())
            {
                Console.SetOut(s);

                p1.ImprimeActores();

                var result = s.ToString().Trim().Replace("\r", "");
                Assert.Equal("Ryan Gosling (1980)\nEmma Stone (1988)", result);
            }
        }
예제 #5
0
        static void Main(string[] args)
        {
            Pelicula p1 = new Pelicula();
            Pelicula p2 = new Pelicula();

            p1.SetTitulo("Spiderman:into the spiderverse");
            p1.SetAño(2018);
            p1.SetDirector("Peter Ramsey");
            p1.SetPais("Estados Unidos");

            p2.SetTitulo("Avatar");
            p2.SetAño(2009);
            p2.SetDirector("James Cameron");
            p2.SetPais("Estados Unidos");

            Console.WriteLine("{0}, {1}, {2}, {3}\n", p1.GetTitulo(), p1.GetAño(), p1.GetDirector(), p1.GetPais());

            Console.WriteLine("{0}, {1}, {2}, {3}\n", p2.GetTitulo(), p2.GetAño(), p2.GetDirector(), p2.GetPais());

            Console.ReadLine();
        }
예제 #6
0
        static void Main(string[] args)
        {
            //Objetos
            Pelicula P1 = new Pelicula();

            P1.Settitulo("La forma del agua");
            P1.Setaño(2018);
            Console.WriteLine("{0}({1})", P1.Gettitulo(), P1.Getaño());

            Pelicula P2 = new Pelicula();

            P2.Settitulo("Argo");
            P2.Setaño(2013);
            Console.WriteLine("{0}({1})", P2.Gettitulo(), P2.Getaño());

            P1.AgregarActor(new Actor("Doug Jones", 1960));
            P2.AgregarActor(new Actor("Ben Affleck", 1972));
            P1.Imprime();
            P1.ImprimeActores();
            P2.Imprime();
            P2.ImprimeActores();
        }
예제 #7
0
파일: Program.cs 프로젝트: zefra/p.oo
        static void Main()
        {
            Pelicula p1 = new Pelicula();

            p1.SetTitulo("Code geass");
            p1.SetAños(2007);
            p1.AgregarActor(new Actor("Lelouch", 1980));
            p1.AgregarActor(new Actor("Suzaku", 1988));

            p1.ImprimeActores();
            Console.WriteLine("{0}({1})", p1.GetTitulo(), p1.GetEstreno());

            Pelicula p2 = new Pelicula();

            p2.SetTitulo("Code geass 2 ");
            p2.SetAños(2008);
            p2.AgregarActor(new Actor("Lelouch", 1980));
            p2.AgregarActor(new Actor("Schneizel", 1990));

            p2.ImprimeActores();
            Console.WriteLine("{0}({1})", p2.GetTitulo(), p2.GetEstreno());

            Pelicula p3 = new Pelicula();

            p3.SetTitulo("El Renacer de lelouch ");
            p3.SetAños(2019);
            p3.AgregarActor(new Actor("Lelouch", 1980));
            p3.AgregarActor(new Actor("Kyoshiro toudou", 1989));

            p3.ImprimeActores();
            Console.WriteLine("{0}({1})", p3.GetTitulo(), p3.GetEstreno());

            Pelicula p4 = new Pelicula();

            p4.SetTitulo("La Sirenita ");
            p4.SetAños(1277);
            p4.AgregarActor(new Actor("Wos", 1993));
            p4.AgregarActor(new Actor("Cacha", 1994));

            p4.ImprimeActores();
            Console.WriteLaine("{0}({1})", p4.GetTitulo(), p4.GetEstreno());

            Pelicula p5 = new Pelicula();

            p5.SetTitulo(" Yugioh");
            p5.SetAños(2000);
            p5.AgregarActor(new Actor("Yugi", 1995));
            p5.AgregarActor(new Actor("Kaiba", 1997));

            p5.ImprimeActores();
            Console.WriteLine("{0}({1})", p5.GetTitulo(), p5.GetEstreno());

            Pelicula p6 = new Pelicula();

            p6.SetTitulo("Zefra ");
            p6.SetAños(2020);
            p6.AgregarActor(new Actor("Tricstar", 1995));
            p6.AgregarActor(new Actor("Burning Abyss", 1996));

            p6.ImprimeActores();
            Console.WriteLine("{0}({1})", p6.GetTitulo(), p6.GetEstreno());
            //Esto es para poder imprimir los datos de las peliculas con sus fechas
            p1.imprime();
            p2.imprime();
            p3.imprime();
            p4.imprime();
            p5.imprime();
            p6.imprime();
        }