GetDepth() public méthode

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. ///
Résultat 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);
 }
Exemple #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);
 }
Exemple #6
0
        public void Ancestry()
        {
            RollbackRuleAttribute rr = new RollbackRuleAttribute("System.Exception");

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

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

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