public void GetTransactionAttribute()
 {
     MatchAlwaysTransactionAttributeSource tas = new MatchAlwaysTransactionAttributeSource();
     ITransactionAttribute ta = tas.ReturnTransactionAttribute(typeof (Object).GetMethod("GetHashCode"), null);
     Assert.IsNotNull(ta);
     Assert.IsTrue(TransactionPropagation.Required == ta.PropagationBehavior);
     tas.TransactionAttribute = new DefaultTransactionAttribute(TransactionPropagation.Supports);
     ta =
         tas.ReturnTransactionAttribute(typeof (DataException).GetType().GetMethod("GetHashCode"),
                                        typeof (DataException));
     Assert.IsNotNull(ta);
     Assert.IsTrue(TransactionPropagation.Supports == ta.PropagationBehavior);
 }
        public void GetTransactionAttribute()
        {
            MatchAlwaysTransactionAttributeSource tas = new MatchAlwaysTransactionAttributeSource();
            ITransactionAttribute ta = tas.ReturnTransactionAttribute(typeof(Object).GetMethod("GetHashCode"), null);

            Assert.IsNotNull(ta);
            Assert.IsTrue(TransactionPropagation.Required == ta.PropagationBehavior);
            tas.TransactionAttribute = new DefaultTransactionAttribute(TransactionPropagation.Supports);
            ta =
                tas.ReturnTransactionAttribute(typeof(DataException).GetType().GetMethod("GetHashCode"),
                                               typeof(DataException));
            Assert.IsNotNull(ta);
            Assert.IsTrue(TransactionPropagation.Supports == ta.PropagationBehavior);
        }
        public void CanConfigureInAppContext()
        {
            TypeRegistry.RegisterType("TransactionPropagation", typeof(TransactionPropagation));
            IApplicationContext ctx =
                new XmlApplicationContext(
                    "assembly://Spring.Data.Tests/Spring.Transaction.Interceptor/MatchAlwaysTransactionAttributeSourceTests.xml");
            MatchAlwaysTransactionAttributeSource tas =
                (MatchAlwaysTransactionAttributeSource)ctx.GetObject("MatchAlwaysTransactionAttributeSource");

            Assert.AreEqual(TransactionPropagation.RequiresNew,
                            tas.ReturnTransactionAttribute(null, null).PropagationBehavior);
        }