コード例 #1
0
        public void AddBankInfoItem()
        {
            exchangeRate.AddBankInfo(exchangeRateItem);  //add BankInfo item in collection

            int expected = 1;                            //expected items count
            int actual   = exchangeRate.BanksInfo.Count; //actual items count

            Assert.AreEqual(expected, actual);
        }
コード例 #2
0
        //add banks info to the exchangeRate class
        private void AddBankInfoValues()
        {
            exchangeRate = new ExchangeRate();

            try
            {
                /*exchangeRate.AddBankInfo(1, "Ощадбанк", "https://www.oschadbank.ua/ru/private/currency/currency_rates/", @"<td class=""text-right"">(\d+\.\d+)</td>", 1, 2);
                 * exchangeRate.AddBankInfo(2, "УКРГАЗБАНК", "https://www.ukrgasbank.com/", @"<td class=""val"">(\d+\.\d+)</td>", 0, 1);
                 * exchangeRate.AddBankInfo(3, "УКРГАЗБАНК", "https://www.ukrgasbank.com/", @"<td class=""val"">(\d+\.\d+)</td>", 0, 1);
                 * exchangeRate.AddBankInfo(4, "УКРГАЗБАНК", "https://www.ukrgasbank.com/", @"<td class=""val"">(\d+\.\d+)</td>", 0, 1);*/
                var resultsFromFile = FileHelper.ReadFromFile();

                foreach (var item in resultsFromFile)
                {
                    exchangeRate.AddBankInfo(item);
                }
            }
            catch (Exception e) //if bank id is already in the exchangeRate class
            {
                MessageBox.Show(e.Message);
            }
        }