/// <summary>
        /// Metóda na generovanie IBAN.
        /// </summary>
        /// <returns></returns>
        public string GenerateIBAN()
        {
            Random random = new Random();

            Iban iban = new IbanBuilder().CountryCode(CountryCode.GetCountryCode("SK"))
                        .BankCode("1111")
                        .AccountNumberPrefix("666666")
                        .AccountNumber(random.Next(1000000000, Int32.MaxValue).ToString())
                        .Build();

            IsValidIBan(iban.ToString());
            return(iban.ToString());
        }
Beispiel #2
0
        public void Belarus_IbanBuilderShouldBuildValidIban()
        {
            Iban belarusIban = new IbanBuilder().CountryCode(CountryCode.GetCountryCode("BY"))
                               .AccountNumber("2966000000")
                               .BankCode("AKBB")
                               .BalanceAccountNumber("1010")
                               .Build();

            Assert.AreEqual("BY86AKBB10100000002966000000", belarusIban.ToString());
        }
Beispiel #3
0
        public void IbanCreationFromPartsShouldSucceed()
        {
            // all parts will autopad itselves
            Iban iban = new IbanBuilder().CountryCode(CountryCode.GetCountryCode("CZ"))
                        .BankCode("2010")
                        .AccountNumber("2300121591")
                        .Build();

            Assert.AreEqual("CZ2820100000002300121591", iban.ToString());
        }
        public string IbanGerate()
        {
            Iban iban = new IbanBuilder()
                        .CountryCode(CountryCode.GetCountryCode("BY"))
                        .BankCode("505")
                        .AccountNumberPrefix("19")
                        .Build();

            return(iban.ToString());
        }
Beispiel #5
0
        public void Madagascar_IbanBuilderShouldBuildValidIban()
        {
            Iban madagascarIban = new IbanBuilder().CountryCode(CountryCode.GetCountryCode("MG"))
                                  .BankCode("00005")
                                  .BranchCode("03007")
                                  .AccountNumber("12894210160")
                                  .NationalCheckDigit("45")
                                  .Build();

            Assert.AreEqual("MG4600005030071289421016045", madagascarIban.ToString());
        }
Beispiel #6
0
        public string GenerateIBAN()
        {
            Random rand           = new Random();
            string randAccountNo  = rand.Next(0, 99999).ToString("00000");
            string randAccountNo2 = rand.Next(0, 99999).ToString("00000");
            Iban   iban           = new IbanBuilder()
                                    .CountryCode(CountryCode.GetCountryCode(GlobalConfig.MAIN_COUNTRY_CODE))
                                    .BankCode(GlobalConfig.BANK_CODE)
                                    .AccountNumberPrefix(GlobalConfig.ACCOUNT_PREFIX)
                                    .AccountNumber(randAccountNo + randAccountNo2)
                                    .Build();

            return(iban.ToString());
        }