GetDepth() public method

Return the depth to the matching superclass execption System.Type.
A return value of 0 means that the exceptionType matches.
public GetDepth ( Type exceptionType ) : int
exceptionType System.Type /// The of exception to find. ///
return int
 public void AlwaysTrue()
 {
     RollbackRuleAttribute rr = new RollbackRuleAttribute("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);
 }
Ejemplo n.º 2
0
        public void AlwaysTrue()
        {
            RollbackRuleAttribute rr = new RollbackRuleAttribute("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);
        }
 public void Ancestry()
 {
     RollbackRuleAttribute rr = new RollbackRuleAttribute("System.Exception");
     Assert.IsTrue(rr.GetDepth(typeof (DataException)) == 2);
 }
 public void NotFound()
 {
     RollbackRuleAttribute rr = new RollbackRuleAttribute("System.Data.DataException");
     Assert.IsTrue(rr.GetDepth(typeof (ApplicationException)) == -1);
 }
 public void FoundImmediatelyWithType()
 {
     RollbackRuleAttribute rr = new RollbackRuleAttribute(typeof (Exception));
     Assert.IsTrue(rr.GetDepth(typeof (Exception)) == 0);
 }
Ejemplo n.º 6
0
        public void Ancestry()
        {
            RollbackRuleAttribute rr = new RollbackRuleAttribute("System.Exception");

            Assert.IsTrue(rr.GetDepth(typeof(DataException)) == 2);
        }
Ejemplo n.º 7
0
        public void NotFound()
        {
            RollbackRuleAttribute rr = new RollbackRuleAttribute("System.Data.DataException");

            Assert.IsTrue(rr.GetDepth(typeof(ApplicationException)) == -1);
        }
Ejemplo n.º 8
0
        public void FoundImmediatelyWithType()
        {
            RollbackRuleAttribute rr = new RollbackRuleAttribute(typeof(Exception));

            Assert.IsTrue(rr.GetDepth(typeof(Exception)) == 0);
        }