Exemplo n.º 1
0
        static void Main(string[] args)
        {
            /*System.Threading.Thread.CurrentThread.CurrentCulture = System.Globalization.CultureInfo.InvariantCulture;
             * Dataset data = new Dataset("Primjerdata.txt");
             * data.LoadDataFromCSV("Primjerdata.txt");
             * Analyzer3rdParty analyzerX = new Analyzer3rdParty();
             * Adapter adapt = new Adapter(analyzerX);
             * double[] Column = adapt.CalculateAveragePerColumn(data);
             * double[] Raw = adapt.CalculateAveragePerRow(data);
             * for (int i = 0; i<Column.Length;i++)
             * {
             *  Console.WriteLine(Column[i]);
             * }
             * for (int i = 0; i < Raw.Length; i++)
             * {
             *  Console.WriteLine(Raw[i]);
             * }*/

            /*List<IRentable> Rented = new List<IRentable>();
             * Rented.Add(new Book("Lord of the Rings"));
             * Rented.Add(new Video("Hobbit"));
             * RentingConsolePrinter Printer = new RentingConsolePrinter();
             * Printer.DisplayItems(Rented);
             * Printer.PrintTotalPrice(Rented);
             *
             * Rented.Add(new HotItem(new Video("Top 10 funny moments")));
             * Rented.Add(new HotItem(new Book("Kuharica")));
             * Printer.DisplayItems(Rented);
             * Printer.PrintTotalPrice(Rented);
             * // poveća se cijena zbog hot itema
             *
             * Console.WriteLine("Nova lista flashSale:");
             * List<IRentable> flashSale = new List<IRentable>();
             * flashSale.Add(new DiscountedItem(new Book("Lord of the Rings"),30));
             * flashSale.Add(new DiscountedItem(new Video("Hobbit"),25));
             * flashSale.Add(new DiscountedItem(new Book("Top 10 funny moments"),40));
             * flashSale.Add(new DiscountedItem(new Video("Kuharica"),60));
             * Printer.DisplayItems(flashSale);
             * Printer.PrintTotalPrice(flashSale);*/

            string email    = "*****@*****.**";
            string password = "******";

            PasswordValidator passwordValidator = new PasswordValidator(8);
            EmailValidator    emailValidator    = new EmailValidator();

            if ((passwordValidator.IsValidPassword(password)) && (emailValidator.IsValidAddress(email)))
            {
                Console.WriteLine("Logged in!");
            }
            else
            {
                Console.WriteLine("Invalid Password or email!");
            }
        }
Exemplo n.º 2
0
        public static void Zadatak6()
        {
            Console.WriteLine("Zadatak 6\n");
            EmailValidator    emailValidator    = new EmailValidator();
            PasswordValidator passwordValidator = new PasswordValidator(5);
            string            email             = "*****@*****.**";
            string            password          = "******";

            Console.WriteLine(email + " is" + (emailValidator.IsValidAddress(email) ? "" : " not") + " valid!");
            Console.WriteLine(password + " is" + (passwordValidator.IsValidPassword(password) ? "" : " not") + " valid!");
            Console.WriteLine("\n***************************************\n");
        }
Exemplo n.º 3
0
 public bool IsUserEntryValid(UserEntry entry)
 {
     return(emailValidator.IsValidAddress(entry.Email) && passwordValidator.IsValidPassword(entry.Password));
 }