File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 77using Unity . Interception . ContainerIntegration ;
88using Unity . Lifetime ;
99using System . Diagnostics ;
10+ using Unity ;
11+ using Unity . Interception ;
1012
11- namespace Unity . Interception . Tests
13+ namespace UnityInterception . Tests
1214{
1315 [ TestClass ]
1416 public class Issues
1517 {
18+
19+ [ TestMethod ]
20+ public void unitycontainer_unity_45 ( )
21+ {
22+ var proxy = Intercept . ThroughProxy < IInterface < string , string > > (
23+ new Thing ( ) ,
24+ new InterfaceInterceptor ( ) ,
25+ new [ ] { new TestInterceptor ( ) } ) ;
26+
27+ proxy . DoSomething ( "hello world" ) ;
28+ }
29+
30+ public interface IInterface < in TIn , out TOut >
31+ {
32+ TOut DoSomething ( TIn input ) ;
33+ }
34+
35+ public class Thing : IInterface < string , string >
36+ {
37+ public string DoSomething ( string input )
38+ {
39+ return input ;
40+ }
41+ }
42+
43+ public class TestInterceptor : IInterceptionBehavior
44+ {
45+ public bool WillExecute => true ;
46+
47+ public IEnumerable < Type > GetRequiredInterfaces ( )
48+ {
49+ return Type . EmptyTypes ;
50+ }
51+
52+ public IMethodReturn Invoke ( IMethodInvocation input , GetNextInterceptionBehaviorDelegate getNext )
53+ {
54+ return getNext ( ) ( input , null ) ;
55+ }
56+ }
57+
58+
1659 [ TestMethod ]
1760 public void unitycontainer_interception_162 ( )
1861 {
You can’t perform that action at this time.
0 commit comments