Beispiel #1
0
 public void SaveGoogleBaseProduct(GoogleBaseProduct item)
 {
     if (item.ProductVariant != null)
     {
         item.ProductVariant.GoogleBaseProducts.Clear();
         item.ProductVariant.GoogleBaseProducts.Add(item);
     }
     _session.Transact(session => session.SaveOrUpdate(item));
 }
        public void GoogleBaseService_SaveGoogleBaseProduct_ShouldUpdateItem()
        {
            var pv = new ProductVariant();
            var item = new GoogleBaseProduct { ProductVariant = pv };

            Session.Transact(session => session.Save(item));
            item.Grouping = "Group2";

            _googleBaseManager.SaveGoogleBaseProduct(item);
            Session.Evict(item);

            Session.QueryOver<GoogleBaseProduct>().SingleOrDefault().Grouping.Should().Be("Group2");
        }