Testing Serverless Applications - Part 1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class FunctionFactory | |
{ | |
public FunctionFactory() | |
: this(null) | |
{ | |
} | |
public FunctionFactory(RegistrationHandler handler = null) | |
{ | |
this.ServiceLocator = new ServiceLocatorBuilder().RegisterModule<AppModule>(handler).Build(); | |
} | |
public virtual IServiceLocator ServiceLocator { get; set; } | |
public virtual TFunction Create<TFunction>(ILogger log) | |
where TFunction : IFunction | |
{ | |
var function = this.ServiceLocator.GetInstance<TFunction>(); | |
function.Log = log; | |
function.ServiceLocator = this.ServiceLocator; | |
return function; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment