public virtual Blog Create(String name) { ITransactionManager transactionManager = kernel[typeof(ITransactionManager)] as ITransactionManager; Assert.IsNotNull(transactionManager); Assert.IsNotNull(transactionManager.CurrentTransaction); return(_blogDao.CreateBlog(name)); }
public void ExecuteMethodUntilSignal() { _startEvent.WaitOne(int.MaxValue, false); while (!_stopEvent.WaitOne(1, false)) { _dao.CreateBlog("my blog"); IList blogs = _dao.ObtainBlogs(); Assert.IsNotNull(blogs); Assert.IsTrue(blogs.Count > 0); } }
public void CommonUsage() { IWindsorContainer container = CreateConfiguredContainer(); container.AddComponent("blogdao", typeof(BlogDao)); BlogDao dao = (BlogDao)container["blogdao"]; dao.CreateBlog("my blog"); IList blogs = dao.ObtainBlogs(); Assert.IsNotNull(blogs); Assert.AreEqual(1, blogs.Count); }
public void TransactionalUsage() { IWindsorContainer container = CreateConfiguredContainer(); container.AddFacility("transaction", new TransactionFacility()); container.AddComponent("blogdao", typeof(BlogDaoTransactional)); BlogDao dao = (BlogDao)container["blogdao"]; dao.CreateBlog("my blog"); IList blogs = dao.ObtainBlogs(); Assert.IsNotNull(blogs); Assert.AreEqual(1, blogs.Count); }