Пример #1
0
        public void Setup()
        {
            this.mock = new Mock <IRepository <Creators> >();
            List <Creators> list = new List <Creators>()
            {
                new Creators()
                {
                    creator_id = 1, creator_name = "AVA JACKSON", creator_email = "*****@*****.**", creator_birth_date = DateTime.Parse("1980-10-06"), creator_premium = 1
                },
                new Creators()
                {
                    creator_id = 4, creator_name = "ISOBEL HANSEN", creator_email = "*****@*****.**", creator_birth_date = DateTime.Parse("1975-03-13"), creator_premium = 0
                },
                new Creators()
                {
                    creator_id = 5, creator_name = "JOSE CHAPMAN", creator_email = "*****@*****.**", creator_birth_date = DateTime.Parse("1977-01-11"), creator_premium = 1
                },
                new Creators()
                {
                    creator_id = 6, creator_name = "LAURIE GEORGE", creator_email = "*****@*****.**", creator_birth_date = DateTime.Parse("1977-07-13"), creator_premium = 1
                },
                new Creators()
                {
                    creator_id = 13, creator_name = "MARCUS FRANKLIN", creator_email = "MARCUS [email protected]", creator_birth_date = DateTime.Parse("1986-10-27"), creator_premium = 0
                },
                new Creators()
                {
                    creator_id = 15, creator_name = "SOFIA BISHOP", creator_email = "*****@*****.**", creator_birth_date = DateTime.Parse("1987-07-16"), creator_premium = 0
                }
            };

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

            this.logic = new CreatorsLogic(this.mock.Object);
        }
Пример #2
0
        public void EmptyRepository()
        {
            Mock <IRepository <Creators> > empty = new Mock <IRepository <Creators> >();

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

            CreatorsLogic l = new CreatorsLogic(empty.Object);

            Assert.That(l.GetAll().Count(), Is.Zero);
        }
Пример #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();
            }
        }