Class AcceptanceTestScaffold
A scaffold class that can be used to set up Function Monkey acceptance tests designed for test frameworks that make use of setup and teardown methods.
Inheritance
Namespace: FunctionMonkey.Testing
Assembly: FunctionMonkey.Testing.dll
Syntax
public class AcceptanceTestScaffold : object
Properties
| Improve this Doc View SourceDispatcher
Provides access to the command dispatcher registered in the service provider but wrapped in a decorator that implements validation.
Declaration
public ICommandDispatcher Dispatcher { get; }
Property Value
Type | Description |
---|---|
ICommand |
ServiceProvider
The constructed service provider
Declaration
public IServiceProvider ServiceProvider { get; }
Property Value
Type | Description |
---|---|
IService |
Methods
| Improve this Doc View SourceAddEnvironmentVariables(Stream, Boolean)
Add environment variables from a stream containing a Functions app settings file
Declaration
public void AddEnvironmentVariables(Stream appSettingsStream, bool oneTimeOnly = true)
Parameters
Type | Name | Description |
---|---|---|
Stream | appSettingsStream | The app settings stream |
System. |
oneTimeOnly | Defaults to true, if true only set the variables one time |
AddEnvironmentVariables(String, Boolean)
Add environment variables from a file containing a Functions app settings file
Declaration
public void AddEnvironmentVariables(string appSettingsPath, bool oneTimeOnly = true)
Parameters
Type | Name | Description |
---|---|---|
System. |
appSettingsPath | A path to the app settings file |
System. |
oneTimeOnly | Defaults to true, if true only set the variables one time |
ExecuteHttpAsync(ICommand, HttpMethod)
Runs a command through the IActionResult ASP.Net pathways and returns a HTTP response. This is useful for testing end to end HTTP triggered functions without having to actually host the function app. A method only needs specifying in the function supports multiple methods.
Declaration
public Task<Microsoft.AspNetCore.Http.HttpResponse> ExecuteHttpAsync(ICommand command, HttpMethod method = null)
Parameters
Type | Name | Description |
---|---|---|
ICommand | command | |
Http |
method |
Returns
Type | Description |
---|---|
Task<Microsoft. |
ExecuteHttpAsync<TResult>(ICommand<TResult>, HttpMethod)
Runs a command through the IActionResult ASP.Net pathways and returns a HTTP response. This is useful for testing end to end HTTP triggered functions without having to actually host the function app. A method only needs specifying in the function supports multiple methods.
Declaration
public Task<Microsoft.AspNetCore.Http.HttpResponse> ExecuteHttpAsync<TResult>(ICommand<TResult> command, HttpMethod method = null)
Parameters
Type | Name | Description |
---|---|---|
ICommand<TResult> | command | |
Http |
method |
Returns
Type | Description |
---|---|
Task<Microsoft. |
Type Parameters
Name | Description |
---|---|
TResult |
Setup(Assembly, Action<IServiceCollection, ICommandRegistry>, ILogger)
Declaration
public void Setup(Assembly functionAppConfigurationAssembly = null, Action<IServiceCollection, ICommandRegistry> beforeServiceProviderBuild = null, ILogger mockLogger = null)
Parameters
Type | Name | Description |
---|---|---|
Assembly | functionAppConfigurationAssembly | |
Action<IService |
beforeServiceProviderBuild | |
ILogger | mockLogger |