Initial import!

This commit is contained in:
markpollack
2008-05-30 22:55:02 +00:00
commit c478a783c0
2978 changed files with 510966 additions and 0 deletions

View File

@@ -0,0 +1,52 @@
using System;
using System.Data;
using System.Text;
using NUnit.Framework;
using Spring.Aop.Framework;
namespace Spring.Transaction.Interceptor
{
[TestFixture]
public class NoNoRollbackRuleAttributeTests
{
[Test]
public void FoundImmediatelyWithString()
{
NoRollbackRuleAttribute rr = new NoRollbackRuleAttribute("System.Exception");
Assert.IsTrue(rr.GetDepth(typeof(Exception)) == 0);
}
[Test]
public void FoundImmediatelyWithClass()
{
NoRollbackRuleAttribute rr = new NoRollbackRuleAttribute(typeof(Exception));
Assert.IsTrue(rr.GetDepth(typeof(Exception)) == 0);
}
[Test]
public void NotFound()
{
NoRollbackRuleAttribute rr = new NoRollbackRuleAttribute("System.Data.DataException");
Assert.IsTrue(rr.GetDepth(typeof(ApplicationException)) == -1);
}
[Test]
public void Ancestry()
{
NoRollbackRuleAttribute rr = new NoRollbackRuleAttribute("System.Exception");
Assert.IsTrue(rr.GetDepth(typeof(DataException)) == 2);
}
[Test]
public void AlwaysTrue()
{
NoRollbackRuleAttribute rr = new NoRollbackRuleAttribute("System.Exception");
Assert.IsTrue(rr.GetDepth(typeof(SystemException)) > 0);
Assert.IsTrue(rr.GetDepth(typeof(ApplicationException)) > 0);
Assert.IsTrue(rr.GetDepth(typeof(DataException)) > 0);
Assert.IsTrue(rr.GetDepth(typeof(TransactionSystemException)) > 0);
}
[Test]
[ExpectedException(typeof(AopConfigException))]
public void ConstructorArgMustBeAExceptionClass()
{
new NoRollbackRuleAttribute( typeof( StringBuilder ) );
}
}
}