Ejemplo n.º 1
0
        public void Close()
        {
            if (_obj != null)
            {
                _obj = null;
            }

            if (randomobj != null)
            {
                randomobj = null;
            }

            if (fiboCheck != null)
            {
                fiboCheck = null;
            }
        }
Ejemplo n.º 2
0
        public bool WritePins(int param)
        {
            bool hasPinGenerated = false;

            IRandomPinGenerator obj = null;

            try
            {
                obj = new RandomPinGenerator();

                if (param <= 100)
                {
                    foreach (var model in obj.Get(param))
                    {
                        if (!model.IsFibonacci)
                        {
                            Console.WriteLine(model.RandomNumber.ToString("0000"));
                        }
                        else
                        {
                            Console.ForegroundColor = ConsoleColor.Red;
                            Console.WriteLine(model.RandomNumber.ToString("0000"));
                            Console.ResetColor();
                            hasPinGenerated = true;
                        }
                    }
                }
                else
                {
                    hasPinGenerated = false;
                    Console.WriteLine("Err: System only generate PINs for the maximum number of 100. \n ");
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }

            return(hasPinGenerated);
        }
Ejemplo n.º 3
0
 public void Init()
 {
     _obj      = new ProgrammingTest.ProgrammingTest();
     randomobj = new RandomPinGenerator();
     fiboCheck = new FibonacciCheck();
 }