Ejemplo n.º 1
0
        public void Setup()
        {
            this.mock = new Mock <IRepository <Videos> >();
            List <Videos> list = new List <Videos>()
            {
                new Videos()
                {
                    video_id = 1, video_title = "LECSAPOLT ÓCEÁN - 1. RÉSZ", video_description = "NATGEO TV - EREDETI SOROZAT", video_views = 18321, category_id = 33
                },
                new Videos()
                {
                    video_id = 2, video_title = "LECSAPOLT ÓCEÁN - 3. RÉSZ", video_description = "NATGEO TV - EREDETI SOROZAT", video_views = 41423, category_id = 33
                },
                new Videos()
                {
                    video_id = 3, video_title = "GET OUT (2017)", video_description = "EGÉSZ ESTÉS HORROR FILM", video_views = 73273, category_id = 38
                },
                new Videos()
                {
                    video_id = 4, video_title = "KING KONG (1933)", video_description = "KLASSZIKUS HORROR, A LEGJOBBAK KÖZÖTT VAN!", video_views = 547834, category_id = 38
                }
            };

            this.mock.Setup(x => x.GetAll()).Returns(list.AsQueryable());

            this.logic = new VideosLogic(this.mock.Object);
        }
Ejemplo n.º 2
0
        public void EmptyRepository()
        {
            Mock <IRepository <Videos> > empty = new Mock <IRepository <Videos> >();

            empty.Setup(x => x.GetAll()).Returns(new List <Videos>().AsQueryable());

            VideosLogic l = new VideosLogic(empty.Object);

            Assert.That(l.GetAll().Count(), Is.Zero);
        }
Ejemplo n.º 3
0
        /// <summary>
        /// Initializes a new instance of the <see cref="Core"/> class.
        /// Set the menu object and draw menu.
        /// </summary>
        public Core()
        {
            List <string> items = new List <string>()
            {
                "Categories tábla kilistázása",
                "Categories rekord hozzáfűzés",
                "Categories rekord módosítás",
                "Categories rekord törlés",
                "Videos tábla kilistázása",
                "Videos rekord hozzáfűzés",
                "Videos rekord módosítás",
                "Videos rekord törlés",
                "Creators tábla kilistázása",
                "Creators rekord hozzáfűzés",
                "Creators rekord módosítás",
                "Creators rekord törlés",
                "Videók és a hozzá tartozó kategóriák listázása",
                "Videók, feltöltő nevének és nézettség listázása",
                "Top 5 legnézettebb videó",
                "Java végpont figyelése",
                "Program bezárása"
            };

            this.m = new Menu(items);

            this.categoriesLogic = new CategoriesLogic(new CategoryRepository());
            this.videosLogic     = new VideosLogic(new VideoRepository());
            this.creatorsLogic   = new CreatorsLogic(new CreatorRepository());
            this.nonCrudLogic    = new NonCrudLogic();
            this.webLogic        = new WebRequestLogic();

            while (this.m.SelectedMenuItemIndex != this.m.MenuItems.Count - 1)
            {
                this.m.PrintMenu();

                Console.WriteLine(this.m.MenuItems[this.m.SelectedMenuItemIndex]);

                this.CallQruery(this.m.SelectedMenuItemIndex);

                Console.Write("Nyomj meg egy gombot a folytatáshoz...");
                Console.ReadKey();
            }
        }