public void RuleBasedTransactionAttributeToString()
        {
            RuleBasedTransactionAttribute source = new RuleBasedTransactionAttribute();

            source.PropagationBehavior       = TransactionPropagation.Supports;
            source.TransactionIsolationLevel = IsolationLevel.RepeatableRead;
            source.TransactionTimeout        = 10;
            source.ReadOnly = true;
            source.AddRollbackRule(new RollbackRuleAttribute("ArgumentException"));
            source.AddRollbackRule(new NoRollbackRuleAttribute("IllegalTransactionStateException"));

            TransactionAttributeEditor editor = new TransactionAttributeEditor();

            editor.SetAsText(source.ToString());
            ITransactionAttribute ta = editor.Value;

            Assert.AreEqual(source, ta);
            Assert.AreEqual(ta.PropagationBehavior, TransactionPropagation.Supports);
            Assert.AreEqual(ta.TransactionIsolationLevel, IsolationLevel.RepeatableRead);
            Assert.AreEqual(ta.TransactionTimeout, 10);
            Assert.IsTrue(ta.ReadOnly);
            Assert.IsTrue(ta.RollbackOn(new ArgumentException()));
            Assert.IsFalse(ta.RollbackOn(new IllegalTransactionStateException()));

            source.ClearRollbackRules();
            Assert.IsFalse(ta == source);
            source.AddRollbackRule(new RollbackRuleAttribute("ArgumentException"));
            source.AddRollbackRule(new NoRollbackRuleAttribute("IllegalTransactionStateException"));
            Assert.AreEqual(ta, source);
        }
        public void RuleBasedTransactionAttributeToString()
        {
            RuleBasedTransactionAttribute source = new RuleBasedTransactionAttribute();
            source.PropagationBehavior = TransactionPropagation.Supports;
            source.TransactionIsolationLevel = IsolationLevel.RepeatableRead;
            source.TransactionTimeout = 10;
            source.ReadOnly = true;
            source.AddRollbackRule( new RollbackRuleAttribute("ArgumentException"));
            source.AddRollbackRule( new NoRollbackRuleAttribute("IllegalTransactionStateException"));

            TransactionAttributeEditor editor = new TransactionAttributeEditor();
            editor.SetAsText( source.ToString() );
            ITransactionAttribute ta = editor.Value;
            Assert.AreEqual( source, ta );
            Assert.AreEqual( ta.PropagationBehavior, TransactionPropagation.Supports );
            Assert.AreEqual( ta.TransactionIsolationLevel, IsolationLevel.RepeatableRead );
            Assert.AreEqual( ta.TransactionTimeout, 10 );
            Assert.IsTrue( ta.ReadOnly );
            Assert.IsTrue(ta.RollbackOn(new ArgumentException()));
            Assert.IsFalse( ta.RollbackOn(new IllegalTransactionStateException()));

            source.ClearRollbackRules();
            Assert.IsFalse( ta == source );
            source.AddRollbackRule( new RollbackRuleAttribute("ArgumentException"));
            source.AddRollbackRule( new NoRollbackRuleAttribute("IllegalTransactionStateException"));
            Assert.AreEqual( ta, source );
        }