protected void btnCreate_Click(object sender, EventArgs e)
 {
     me = new MockEntity();
     me.Name = "New Mock entity";
     me.Save();
     Session["CRUDtestME"] = me;
 }
        public void ManualRollbackTest()
        {
            MockEntity me = new MockEntity();
            me.Save();
            Assert.IsNotNull(new MockEntityDAO().Get(me.Id));

            new BurrowFramework().CurrentConversation.GiveUp();
            new BurrowFramework().CloseWorkSpace();
            new BurrowFramework().InitWorkSpace();
            Assert.IsNull(new MockEntityDAO().Get(me.Id));
        }
        public void Crud()
        {
            MockEntity2 m2 = new MockEntity2();
            m2.Save();
           RestartBF();
           MockEntity m = new MockEntity();
           m.Save();
           RestartBF();
           Assert.IsNotNull(  MockEntity2DAO.Instance.Get(m2.Id));
           Assert.IsNotNull(  MockEntityDAO.Instance.Get(m.Id));

        }
        public void RollBackShouldCloseWorkSpaceTest()
        {
            ITransactionManager tm = bf.CurrentConversation.TransactionManager;

            tm.Begin();
            MockEntity mo3 = new MockEntity();
            mo3.Save();
            tm.Rollback();
            Assert.IsNull(bf.CurrentConversation);
            bf.InitWorkSpace();
            Assert.IsNull(MockEntityDAO.Instance.Get(mo3.Id), "Rolled back transaction did get commit");
        }
 protected void Page_Load(object sender, EventArgs e)
 {
     if(!IsPostBack)
     {
         MockEntity m = new MockEntity();
         m.Save();
         m.StringList.Add("testString");
         m.StringList.Add("testString2");
         
         bf.GetSession().Clear();
         me = MockEntityDAO.Instance.Get(m.Id); //me is now holding an uninitilized mockEntity
         bf.CurrentConversation.SpanWithPostBacks();
     }
 }
        public void MultipleTransactionTest()
        {
            ITransactionManager tm = bf.CurrentConversation.TransactionManager;
            tm.Begin();
            MockEntity mo1 = new MockEntity();
            mo1.Save();
            tm.Commit();

            tm.Begin();
            MockEntity mo2 = new MockEntity();
            mo2.Save();
            tm.Commit();

            tm.Begin();
            Assert.IsNotNull(MockEntityDAO.Instance.Get(mo1.Id));
            Assert.IsNotNull(MockEntityDAO.Instance.Get(mo2.Id));

            tm.Commit();

            TearDown();
        }