Show / Hide Table of Contents

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
System.Object
AcceptanceTestScaffold
Namespace: FunctionMonkey.Testing
Assembly: FunctionMonkey.Testing.dll
Syntax
public class AcceptanceTestScaffold : object

Properties

| Improve this Doc View Source

Dispatcher

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
ICommandDispatcher
| Improve this Doc View Source

ServiceProvider

The constructed service provider

Declaration
public IServiceProvider ServiceProvider { get; }
Property Value
Type Description
IServiceProvider

Methods

| Improve this Doc View Source

AddEnvironmentVariables(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.Boolean oneTimeOnly

Defaults to true, if true only set the variables one time

| Improve this Doc View Source

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.String appSettingsPath

A path to the app settings file

System.Boolean oneTimeOnly

Defaults to true, if true only set the variables one time

| Improve this Doc View Source

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
HttpMethod method
Returns
Type Description
Task<Microsoft.AspNetCore.Http.HttpResponse>
| Improve this Doc View Source

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
HttpMethod method
Returns
Type Description
Task<Microsoft.AspNetCore.Http.HttpResponse>
Type Parameters
Name Description
TResult
| Improve this Doc View Source

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<IServiceCollection, ICommandRegistry> beforeServiceProviderBuild
ILogger mockLogger

Extension Methods

OpenApiFluentValidationHelper.IsNumeric(Object)
OpenApiFluentValidationHelper.NumericToInt(Object)
OpenApiFluentValidationHelper.NumericToDouble(Object)
OpenApiFluentValidationHelper.NumericToDecimal(Object)
  • Improve this Doc
  • View Source
  • 0 Comments
In This Article
  • Properties
    • Dispatcher
    • ServiceProvider
  • Methods
    • AddEnvironmentVariables(Stream, Boolean)
    • AddEnvironmentVariables(String, Boolean)
    • ExecuteHttpAsync(ICommand, HttpMethod)
    • ExecuteHttpAsync<TResult>(ICommand<TResult>, HttpMethod)
    • Setup(Assembly, Action<IServiceCollection, ICommandRegistry>, ILogger)
  • Extension Methods
Back to top Copyright © 2018 James Randall