Exemplo n.º 1
0
        public void AddBalance_Add100Over100_GetterIs200()
        {
            MainSystem system = new MainSystem();

            system.MakeAccount("092088777");
            system.AddBalance("92088777", 100);
            system.AddBalance("092088777", 100);
            int expected = 200;
            int actual   = system.GetBalance("092088777");

            Assert.AreEqual(expected, actual);
        }
        public void AddBalance_ARGPhoneX110_BalanceAdded()
        {
            MainSystem system = new MainSystem {
                Country = Country.Argentina
            };

            system.MakeAccount(ArgentinaNumberPhone);

            system.AddBalance(ArgentinaNumberPhone, 10);
            system.AddBalance(ArgentinaNumberPhone, 100);
            int actual   = system.GetBalance(ArgentinaNumberPhone);
            int expected = 110;

            Assert.AreEqual(expected, actual);
        }
Exemplo n.º 3
0
        public void AddBalance_BadNumber3OKText_Exception()
        {
            MainSystem system = new MainSystem {
                Country = Country.Uruguay
            };

            system.AddBalance("0928J8777", 300);
        }
        public void AddBalance_NotExistentNumber_Exception()
        {
            MainSystem system = new MainSystem {
                Country = Country.Argentina
            };

            system.AddBalance(ArgentinaNumberPhone, 200);
        }
        public void AddBalance_BADPhone4_BalanceAdded()
        {
            MainSystem system = new MainSystem {
                Country = Country.Argentina
            };

            system.AddBalance("12345", 200);
        }
Exemplo n.º 6
0
        public void AddBalance_EmptyNumberOKText_Exception()
        {
            MainSystem system = new MainSystem {
                Country = Country.Uruguay
            };

            system.AddBalance("", 300);
        }
        public void MakeReserve_OkNumberBADMins3_Exception()
        {
            MainSystem system = new MainSystem {
                Country = Country.Uruguay
            };

            system.MakeAccount("92888777");
            system.AddBalance("92888777", 300);
            system.MakeReserve("92888777", "SBS1234 0");
        }
Exemplo n.º 8
0
        public void GetBalance_100DollarAccount_100Dollar()
        {
            MainSystem system = new MainSystem();

            system.MakeAccount("092555222");
            system.AddBalance("092555222", 100);
            int actual   = system.GetBalance("092555222");
            int expected = 100;

            Assert.AreEqual(expected, actual);
        }
        internal MainSystem MainSystemWith_ARG_Account()
        {
            MainSystem system;

            system = new MainSystem {
                Country = Country.Argentina
            };
            system.MakeAccount(ArgentinaNumberPhone);
            system.AddBalance(ArgentinaNumberPhone, 10000);
            return(system);
        }
        internal MainSystem MainSystemWith_UY_Account()
        {
            MainSystem system;

            system = new MainSystem {
                Country = Country.Uruguay
            };
            system.MakeAccount(UruguayNumberPhone);
            system.AddBalance(UruguayNumberPhone, 1000);
            return(system);
        }
        public void AddReserve_ARG_At(ref MainSystem system, string HourMins, string amount)
        {
            system.Country = Country.Argentina;
            DateTime now = DateTime.Now;

            if (now.Hour > 9 && now.Hour < 17)
            {
                if (!system.ThisAccountExist(ArgentinaNumberPhone))
                {
                    system.MakeAccount(ArgentinaNumberPhone);
                }

                system.AddBalance(ArgentinaNumberPhone, 1000);
                system.AddBalance(ArgentinaNumberPhone, 1000);
                system.MakeReserve(ArgentinaNumberPhone, standarLicencePlate + " " + HourMins + " " + amount);
            }
            else
            {
                Assert.Inconclusive();
            }
        }
        public void GetBalance_Add10Over0_10()
        {
            MainSystem system = new MainSystem {
                Country = Country.Argentina
            };

            system.MakeAccount("12345678");
            system.AddBalance("123-45678", 10);

            int actual   = system.GetBalance("12345678");
            int expected = 10;

            Assert.AreEqual(expected, actual);
        }
Exemplo n.º 13
0
        private void OkButton_Click(object sender, EventArgs e)
        {
            string numberPhone = numberPhoneBox.Text;
            string money       = moneyBox.Text;

            if (!money.All(Char.IsDigit))
            {
                MessageBox.Show("only digits on balance field");
                return;
            }
            try
            {
                system.AddBalance(numberPhone, Int32.Parse(money));
                MessageBox.Show(money + " Added successfully ");
            }
            catch (Exception exception)
            {
                MessageBox.Show(exception.Message);
            }
        }
        public void MakeReserve_OKNumberOKText3_AddedReserve()
        {
            DateTime now = DateTime.Now;

            if (now.Hour > 9 && now.Hour < 17)
            {
                MainSystem system = new MainSystem {
                    Country = Country.Uruguay
                };
                system.MakeAccount("092 088 777");
                system.AddBalance("092 088 777", 300);
                system.MakeReserve("092 088 777", "SBS 1234 90 17:00");
                DateTime dateCheck = new DateTime(now.Year, now.Month, now.Day, 17, 30, 0);
                system.WasTheLicencePlateReserveAt("SBS 1234", dateCheck);
            }
            else
            {
                Assert.Inconclusive();
            }
        }
        public void AddBalance_0Balance_Exception()
        {
            MainSystem system = MainSystemWith_ARG_Account();

            system.AddBalance(ArgentinaNumberPhone, 0);
        }
Exemplo n.º 16
0
        public void AddBalance_Add115onNotRegisteredNumberUY_Exception()
        {
            MainSystem system = MainSystemWith_UY_Account();

            system.AddBalance("092777333", 200);
        }
Exemplo n.º 17
0
        public void AddBalance_ADD0OnRegisteredNumberUY_Exception()
        {
            MainSystem system = MainSystemWith_UY_Account();

            system.AddBalance(UruguayNumberPhone, 0);
        }