public void SimulateClicksTest()
        {
            var context = new MobilniPortalNovicContext12();
            FillDatabase f = new FillDatabase(context);
            var d = DateTime.Now;
            var categoryId = context.Categories.Where(x => x.Name == "Sportal").Select(x => x.CategoryId).First();
            var userId = 1;
            var count = 10;
            var query = f.SimulateClicks(userId, categoryId, count, () => d, ()=>null);
            var dict = CategoryHelpers.CategoryGetChildrensFromParent(context.Categories.ToList());

            foreach (var r in query)
            {
                context.Clicks.Remove(r);
            }
            context.SaveChanges();

            foreach (var r in query)
            {
                Assert.IsTrue(r.UserId == 1);
                Assert.IsTrue(dict[categoryId].Select(x => x.CategoryId).Contains(r.CategoryId));
                Assert.AreEqual(d, r.ClickDate);
            }
        }
        public static void SimulateClicks()
        {
            try
            {
                using (var context = new MobilniPortalNovicContext12())
                {
                    //UserId
                    Console.WriteLine("UserId:");
                    int userId;
                    var i1 = Console.ReadLine();
                    if (Int32.TryParse(i1, out userId) == false)
                    {
                        userId = context.Users.Where(x => x.Username == i1).First().UserId;
                    }

                    //Number clicks
                    Console.WriteLine("Number of clicks");
                    var count = Int32.Parse(Console.ReadLine());

                    //CategoryId
                    Console.WriteLine("Category number");
                    int category;
                    var i2 = Console.ReadLine();
                    if (Int32.TryParse(i2, out category) == false)
                    {
                        category = context.Categories.Where(x => x.Name == i2).First().CategoryId;
                    }

                    //Time function
                    Console.WriteLine("Hour offset from now: (+-random minutes) dayOffset (+-randomDays)");
                    List<int> offset = Console.ReadLine().Split(' ').ToList().Select(x => Int32.Parse(x)).ToList();
                    List<int> defaults = new List<int> { 0, 60, 0, 0 };
                    //Adds default values to not entered values
                    offset.AddRange(defaults.Skip(offset.Count));

                    Func<Coordinates> coordinatesRandom;
                    Console.WriteLine("Location query String");
                    var city = Console.ReadLine();
                    if (city.Length != 0)
                    {
                        Console.WriteLine("Location distance offset:");
                        var distanceOffset = Console.ReadLine();

                        Random rnd = new Random();
                        coordinatesRandom = CreateCoordinatesRandomFunc(city, Int32.Parse(distanceOffset));
                    }
                    else
                    {

                        coordinatesRandom = () => null;
                    }

                    Func<DateTime> dateTimeRandom = CreateDateTimeRandomFunc(offset[0], offset[1], offset[2], offset[3]);

                    var clicks = new FillDatabase(new MobilniPortalNovicContext12()).SimulateClicks(userId,
                        category,
                        count,
                        dateTimeRandom,
                        coordinatesRandom
                    );

                    Console.WriteLine("{0} clicks added.", clicks.Count());
                }
            }
            catch (Exception e)
            {
                Console.WriteLine("Bad input");
            }
        }