Commit 3726ea3 1 parent 2fd1ae0 commit 3726ea3 Copy full SHA for 3726ea3
File tree 1 file changed +28
-0
lines changed
test/Autofac.Test/Features/LazyDependencies
1 file changed +28
-0
lines changed Original file line number Diff line number Diff line change @@ -43,5 +43,33 @@ public void WhenLazyIsResolved_ValueIsNotYetCreated()
43
43
var lazy = container . Resolve < Lazy < object > > ( ) ;
44
44
Assert . False ( lazy . IsValueCreated ) ;
45
45
}
46
+
47
+ [ Fact ( Skip = "#718" ) ]
48
+ public void LazyWorksWithCircularPropertyDependencies ( )
49
+ {
50
+ var builder = new ContainerBuilder ( ) ;
51
+
52
+ builder . RegisterType < A > ( )
53
+ . SingleInstance ( ) ;
54
+ builder . RegisterType < B > ( )
55
+ . SingleInstance ( )
56
+ . PropertiesAutowired ( PropertyWiringOptions . AllowCircularDependencies ) ;
57
+
58
+ var container = builder . Build ( ) ;
59
+ Assert . NotNull ( container . Resolve < A > ( ) ) ;
60
+ }
61
+
62
+ private class A
63
+ {
64
+ public A ( Lazy < B > b )
65
+ {
66
+ var myB = b . Value ;
67
+ }
68
+ }
69
+
70
+ private class B
71
+ {
72
+ public A A { get ; set ; }
73
+ }
46
74
}
47
75
}
You can’t perform that action at this time.
0 commit comments