1+ namespace MattSourceGenHelpers . Abstractions ;
2+
3+ public class MockGeneratorsFactory : IGeneratorsFactory
4+ {
5+ public IMethodBuilder ForMethod ( ) => new MockMethodBuilder ( ) ;
6+
7+ public IMethodImplementationGenerator < TReturnType > CreateImplementation < TReturnType > ( ) => new MockMethodImplementationGenerator < TReturnType > ( ) ;
8+
9+ public IMethodImplementationGenerator < TArg1 , TReturnType > CreateImplementation < TArg1 , TReturnType > ( ) =>
10+ new MockMethodImplementationGenerator < TArg1 , TReturnType > ( ) ;
11+ }
12+
13+ public class MockMethodImplementationGenerator < TReturnType > : IMethodImplementationGenerator < TReturnType >
14+ {
15+ public IMethodImplementationGenerator UseBody ( Func < object > body ) => this ;
16+ }
17+
18+ public class MockMethodImplementationGenerator < TArg1 , TReturnType > : IMethodImplementationGenerator < TArg1 , TReturnType >
19+ {
20+ public IMethodImplementationGeneratorSwitchBody < TArg1 , TReturnType > WithSwitchBody ( ) =>
21+ new MockMethodImplementationGeneratorSwitchBody < TArg1 , TReturnType > ( ) ;
22+ }
23+
24+ public class MockMethodImplementationGeneratorSwitchBody < TArg1 , TReturnType > : IMethodImplementationGeneratorSwitchBody < TArg1 , TReturnType >
25+ {
26+ public IMethodImplementationGeneratorSwitchBodyCase < TArg1 , TReturnType > ForCases ( params object [ ] cases )
27+ => new MockMethodImplementationGeneratorSwitchBodyCase < TArg1 , TReturnType > ( ) ;
28+
29+ public IMethodImplementationGeneratorSwitchBodyDefaultCase < TArg1 , TReturnType > ForDefaultCase ( )
30+ => new MockMethodImplementationGeneratorSwitchBodyDefaultCase < TArg1 , TReturnType > ( ) ;
31+ }
32+
33+ public class MockMethodImplementationGeneratorSwitchBodyDefaultCase < TArg1 , TReturnType > : IMethodImplementationGeneratorSwitchBodyDefaultCase < TArg1 ,
34+ TReturnType >
35+ {
36+ public IMethodImplementationGenerator < TArg1 , TReturnType > ReturnConstantValue ( Func < TArg1 , TReturnType > func )
37+ => new MockMethodImplementationGenerator < TArg1 , TReturnType > ( ) ;
38+
39+ public IMethodImplementationGenerator < TArg1 , TReturnType > UseBody ( Func < TArg1 , Func < TReturnType > > func )
40+ => new MockMethodImplementationGenerator < TArg1 , TReturnType > ( ) ;
41+ }
42+
43+ public class MockMethodImplementationGeneratorSwitchBodyCase < TArg1 , TReturnType > : IMethodImplementationGeneratorSwitchBodyCase < TArg1 , TReturnType >
44+ {
45+ public IMethodImplementationGeneratorSwitchBody < TArg1 , TReturnType > ReturnConstantValue ( Func < TArg1 , TReturnType > constantValueFactory )
46+ => new MockMethodImplementationGeneratorSwitchBody < TArg1 , TReturnType > ( ) ;
47+
48+ public IMethodImplementationGeneratorSwitchBody < TArg1 , TReturnType > UseBody ( Func < TArg1 , Action < TReturnType > > body )
49+ => new MockMethodImplementationGeneratorSwitchBody < TArg1 , TReturnType > ( ) ;
50+ }
51+
52+ public class MockMethodBuilder : IMethodBuilder
53+ {
54+ public IMethodBuilder < TArg1 > WithParameter < TArg1 > ( ) => new MockMethodBuilder < TArg1 > ( ) ;
55+
56+ public IMethodImplementationGenerator < TReturnType > WithReturnType < TReturnType > ( ) => new MockImplementationGenerator < TReturnType > ( ) ;
57+ }
58+
59+ public class MockImplementationGenerator < TReturnType > : IMethodImplementationGenerator < TReturnType >
60+ {
61+ public IMethodImplementationGenerator UseBody ( Func < object > body ) => this ;
62+ }
63+
64+ public class MockMethodBuilder < TArg1Input > : IMethodBuilder < TArg1Input >
65+ {
66+ public IMethodImplementationGenerator < TArg1Input , TReturnType > WithReturnType < TReturnType > ( )
67+ => new MockMethodImplementationGenerator < TArg1Input , TReturnType > ( ) ;
68+ }
0 commit comments