Пример #1
0
        public AtomFileCollection GetFiles(int productId)
        {
            AtomFileCollection files = new AtomFileCollection();

            foreach (TestDatabaseProduct product in m_Products)
            {
                if (product.Product.Product.Id == productId)
                {
                    foreach (TestDatabaseFile file in product.Files)
                    {
                        files.Add(file.File);
                    }
                }
            }
            return(files);
        }
Пример #2
0
        /// <summary>
        /// Get a list of all files associated with a product.
        /// </summary>
        /// <param name="product">Product for which the files are required.</param>
        /// <returns>List of files.</returns>
        public AtomFileCollection GetFiles(AtomProduct product)
        {
            if (product == null)
            {
                throw new ArgumentNullException("product");
            }

            if (String.IsNullOrEmpty(product.Product.FilesLink))
            {
                throw new ArgumentException("No files link present", "product");
            }

            AtomFileCollection files = new AtomFileCollection();

            return(m_TestDatabase.GetFiles(product.Product.Id));
        }