Example #1
0
 /// <summary>
 /// Initializes a new instance of the <see cref="CurrencyConverter"/> class.
 /// </summary>
 /// <param name="tablesProvider">The tables provider.</param>
 public CurrencyConverter(ITablesProvider tablesProvider)
 {
     this.AvailableCurrencies = new List <Currency>();
     this.CurrencyTable       = tablesProvider.GetCurrencyTable();
     this.UpdateRates();
     this.UpdateDbCurrencies();
 }
        public CurrencyConverterTests()
        {
            ICurrencyTable         currencyTable = new CurrencyTable();
            Mock <ITablesProvider> table         = new Mock <ITablesProvider>();

            table.Setup(x => x.GetCurrencyTable()).Returns(currencyTable);

            this.tablesProvider = table.Object;
        }
Example #3
0
        public CategoriesUpdaterTests()
        {
            CategoryTable          categoryTable = new CategoryTable();
            Mock <ITablesProvider> mock          = new Mock <ITablesProvider>();

            mock.Setup(x => x.GetCategoryTable()).Returns(categoryTable);

            tables = mock.Object;
        }
        /// <summary>
        /// Initializes a new instance of the <see cref="BiddingBroker"/> class.
        /// </summary>
        /// <param name="tablesProvider">The tables provider.</param>
        public BiddingBroker(ITablesProvider tablesProvider)
        {
            this.auctions = new List <Auction>();

            this.tablesProvider = tablesProvider;

            this.currencyConverter = new CurrencyConverter(tablesProvider);

            this.UpdateCategories();
            this.UpdateCurrencies();
            this.LoadAuctions();
        }
 /// <summary>
 /// Updates the categories.
 /// </summary>
 /// <param name="tablesProvider">The tables provider.</param>
 public static void UpdateCategories(ITablesProvider tablesProvider)
 {
     TablesProvider = tablesProvider;
     try
     {
         UpdateElectronics();
         UpdateHome();
     }
     catch (Exception e)
     {
         throw e;
     }
 }