Beispiel #1
0
        /*[!-- TODO: This completely ignores currency --)]
         * [query(name="minBid")][![CDATA[
         * select b from Bid b where b.amount.value =
         * (select min(b.amount.value) from Bid b where b.item.id = :itemid)
         * ]])][/query)]
         *
         * [!-- TODO: This completely ignores currency --)]
         * [query(name="maxBid")][![CDATA[
         * select b from Bid b where b.amount.value =
         *      (select max(b.amount.value) from Bid b where b.item.id = :itemid)
         * ]])][/query)]*/


        public virtual void AddCategorizedItem(CategorizedItem catItem)
        {
            if (catItem == null)
            {
                throw new ArgumentException("Can't add a null CategorizedItem.");
            }
            CategorizedItems.Add(catItem);
        }
        public void Can_Save_Load_CategorizedItem()
        {
            Category myItems = new Category("My Items");
            categories.MakePersistent(myItems);
            CategorizedItem ci = new CategorizedItem(tobin.Username, myItems, iMac);

            //TODO: Remove explicit saving of categorized item in this test. This should be persisted by reachability?
            NHibernateHelper.Session.Save(ci);
            NHibernateHelper.CommitTransaction();

            Item reloaded = items.GetById(iMac.Id);
            Assert.AreEqual(1, reloaded.CategorizedItems.Count);
        }
Beispiel #3
0
 public virtual void AddCategorizedItem(CategorizedItem catItem)
 {
     if (catItem == null)
         throw new ArgumentException("Can't add a null CategorizedItem.");
     CategorizedItems.Add(catItem);
 }