@@ -22,13 +22,13 @@ public void SimpleCircularDependency()
22
22
{
23
23
var circularDependency = container . GetInstance < ISimpleCircularDependency1 > ( ) ;
24
24
} ) ;
25
- var cycleError1 = Assert . IsType < CircularDependencyException > ( dependencyResolveException1 . InnerException ) ;
25
+ var cycleError1 = Assert . IsType < CircularDependencyException > ( dependencyResolveException1 . InnerException ? . InnerException ? . InnerException ) ;
26
26
27
27
var dependencyResolveException2 = Assert . Throws < DependencyResolveException > ( ( ) =>
28
28
{
29
29
var circularDependency = container . GetInstance < ISimpleCircularDependency2 > ( ) ;
30
30
} ) ;
31
- var cycleError2 = Assert . IsType < CircularDependencyException > ( dependencyResolveException2 . InnerException ) ;
31
+ var cycleError2 = Assert . IsType < CircularDependencyException > ( dependencyResolveException2 . InnerException ? . InnerException ? . InnerException ) ;
32
32
33
33
34
34
Assert . Equal ( 3 , cycleError1 . Cycle . Length ) ;
@@ -59,19 +59,19 @@ public void ComplexCircularDependency()
59
59
{
60
60
var circularDependency = container . GetInstance < IComplexCircularDependency1 > ( ) ;
61
61
} ) ;
62
- var cycleError1 = Assert . IsType < CircularDependencyException > ( dependencyResolveException1 . InnerException ) ;
62
+ var cycleError1 = Assert . IsType < CircularDependencyException > ( dependencyResolveException1 . InnerException ? . InnerException ? . InnerException ? . InnerException ) ;
63
63
64
64
var dependencyResolveException2 = Assert . Throws < DependencyResolveException > ( ( ) =>
65
65
{
66
66
var circularDependency = container . GetInstance < IComplexCircularDependency2 > ( ) ;
67
67
} ) ;
68
- var cycleError2 = Assert . IsType < CircularDependencyException > ( dependencyResolveException2 . InnerException ) ;
68
+ var cycleError2 = Assert . IsType < CircularDependencyException > ( dependencyResolveException2 . InnerException ? . InnerException ? . InnerException ? . InnerException ) ;
69
69
70
70
var dependencyResolveException3 = Assert . Throws < DependencyResolveException > ( ( ) =>
71
71
{
72
72
var circularDependency = container . GetInstance < IComplexCircularDependency3 > ( ) ;
73
73
} ) ;
74
- var cycleError3 = Assert . IsType < CircularDependencyException > ( dependencyResolveException3 . InnerException ) ;
74
+ var cycleError3 = Assert . IsType < CircularDependencyException > ( dependencyResolveException3 . InnerException ? . InnerException ? . InnerException ? . InnerException ) ;
75
75
76
76
Assert . Equal ( 4 , cycleError1 . Cycle . Length ) ;
77
77
Assert . Equal ( typeof ( IComplexCircularDependency1 ) . AssemblyQualifiedName , cycleError1 . Cycle [ 0 ] ) ;
0 commit comments