Пример #1
0
        public void Initialize()
        {
            int index     = 0;
            int max_index = 100;

            db_user        = DBCustomUser.GetInstance();
            db_product     = DB_Product.GetInstance();
            db_userproduct = DB_UserProduct.GetInstance();
            Product product;

            user = new CustomUser
            {
                Username = "******",
                Password = "******",
                Email    = "ClassLibriry1 - Test UserProduct Database - User",
                Wallet   = 5000.0,
                IsActive = true,
                LoggedIn = true
            };

            db_user.CreateUser(user);

            while (index < max_index)
            {
                product = new Product
                {
                    Name  = "ClassLibriry1 - Test UserProduct Database - Product",
                    Price = 50.0 + (double)index
                };

                db_product.CreateProduct(product);
                index++;
            }

            products = db_product.FindProductByPriceHigher(25.0);
        }
 /// <summary>
 /// This is the constructor for the class CTR_UserProduct.
 /// </summary>
 public CTR_UserProduct()
 {
     this.db_userproduct = DB_UserProduct.GetInstance();
 }