Exemplo n.º 1
0
        /// <summary>
        /// Prevents a default instance of the <see cref="DomainDataStorage"/> class from being created.
        /// </summary>
        private DomainDataStorage()
        {
            string connectionString = ConfigurationManager.ConnectionStrings["MySQL"].ConnectionString;

            this.databaseConneection = new MySqlConnection(connectionString);

            this.auctionTable       = this.databaseConneection.As <IAuctionTable>();
            this.bidTable           = this.databaseConneection.As <IBidTable>();
            this.categoryTable      = this.databaseConneection.As <ICategoryTable>();
            this.currencyTable      = this.databaseConneection.As <ICurrencyTable>();
            this.personBidderTable  = this.databaseConneection.As <IPersonBidderTable>();
            this.personMarkTable    = this.databaseConneection.As <IPersonMarkTable>();
            this.personOfferorTable = this.databaseConneection.As <IPersonOfferorTable>();
            this.personTable        = this.databaseConneection.As <IPersonTable>();
            this.productTable       = this.databaseConneection.As <IProductTable>();
        }
        public void UpdateDbCurrencies_ShouldIncrementsTheCurrenciesInDb()
        {
            ICurrencyTable currencyTable = tablesProvider.GetCurrencyTable();

            int initial_size = currencyTable.FetchAllCurrencies().Count();

            CurrencyConverter converter = new CurrencyConverter();

            converter.CurrencyTable = tablesProvider.GetCurrencyTable();

            converter.AvailableCurrencies.Add(new Currency()
            {
                Name = "dummy"
            });

            converter.UpdateDbCurrencies();

            int actual_size = currencyTable.FetchAllCurrencies().Count();

            Assert.NotEqual(initial_size, actual_size);
        }